<!--
  DTD for gretl command reference. Allin Cottrell 2004
 -->

<!ENTITY ndash  "&#8211;">
<!ENTITY lgr    "&#0955;">
<!ENTITY mu     "&#0956;">
<!ENTITY sigma  "&#0963;">
<!ENTITY hellip "&#8230;">
<!ENTITY mdash  "&#8212;">
<!ENTITY latex  "LaTeX">
<!ENTITY minus  "&#8211;">


<!ELEMENT commandlist (command)+>
<!ATTLIST commandlist
   language    CDATA #REQUIRED
>

<!-- The description is the only element that is absolutely
     required of a command -->

<!ELEMENT command (usage?, description+, gui-access?)>

<!ATTLIST command
   name         CDATA #REQUIRED
   section      (Dataset | Estimation | Graphs | Prediction |
                 Printing | Programming | Statistics | Tests |
                 Obsolete | Transformations | Utilities | 
                 Unknown) "Unknown"
   context      (cli | gui | both) "both"
   label        CDATA #IMPLIED
>

<!ATTLIST description
   context (cli | gui | both) "both"
>

<!ELEMENT usage (arguments?, altforms?, options?, examples?)>

<!ELEMENT arguments    (argument)+>
<!ELEMENT options      (option)+>
<!ELEMENT examples     (example)+>
<!ELEMENT altforms     (altform)+>
<!ELEMENT description  (para | code | ilist | nlist | table)*>
<!ELEMENT gui-access   (menu-path, other-access?)>

<!ELEMENT argument (#PCDATA)>
<!ATTLIST argument 
    separated (true | false) "false"
    optional (true | false) "false"
    alternate (true | false) "false"
    flag CDATA #IMPLIED
>

<!ELEMENT altform (#PCDATA | repl | lit)*>

<!ELEMENT option   (flag, effect)>
<!ELEMENT example  (#PCDATA)>

<!ELEMENT flag    (#PCDATA)>
<!ELEMENT effect  (#PCDATA)>

<!ELEMENT menu-path    (#PCDATA)>
<!ELEMENT other-access (#PCDATA)>

<!ELEMENT para (#PCDATA | repl | program | mathvar | equation |
                lit | emphasis | book | quote | filename |
                func | manref | cmdref| tabref | footnote | cmd)*>

<!ATTLIST para
   context (cli | gui | both) "both"
>

<!ELEMENT code (#PCDATA)>

<!ELEMENT ilist (li)+>
<!ATTLIST ilist 
   context (cli | gui | both) "both"
>

<!ELEMENT nlist (li)+>
<!ATTLIST nlist 
   context (cli | gui | both) "both"
>

<!ELEMENT li (para | code | table)*>

<!-- stuff that can go into paras -->

<!ELEMENT equation EMPTY>
<!ATTLIST equation
   status (inline | display) "inline"
   tex     CDATA #REQUIRED
   ascii   CDATA #REQUIRED
   graphic CDATA #REQUIRED
>

<!ELEMENT manref EMPTY>
<!ATTLIST manref
   targ    CDATA #REQUIRED
>

<!ELEMENT cmdref EMPTY>
<!ATTLIST cmdref
   targ    CDATA #REQUIRED
>

<!ELEMENT tabref EMPTY>
<!ATTLIST tabref
   targ    CDATA #REQUIRED
>

<!ELEMENT footnote (para)+>

<!ELEMENT table (row)+>
<!ELEMENT row (cell)+>
<!ELEMENT cell (#PCDATA | lit | repl | emphasis | 
                mathvar | equation | book | quote)*>
<!ATTLIST table
   lwidth   CDATA #IMPLIED
   rwidth   CDATA #IMPLIED
   id       CDATA #IMPLIED
   title    CDATA #IMPLIED
   lhead    CDATA #IMPLIED
   rhead    CDATA #IMPLIED
   context  (cli | gui | both) "both"
>

<!ELEMENT repl     (#PCDATA)>
<!ELEMENT program  (#PCDATA)>
<!ELEMENT lit      (#PCDATA)>
<!ELEMENT emphasis (#PCDATA)>
<!ELEMENT book     (#PCDATA)>
<!ELEMENT quote    (#PCDATA | lit)*>
<!ELEMENT filename (#PCDATA)>
<!ELEMENT func     (#PCDATA)>
<!ELEMENT cmd      (#PCDATA)>
<!ELEMENT mathvar  (#PCDATA | sub | super)*>
<!ELEMENT sub      (#PCDATA)>
<!ELEMENT super    (#PCDATA)>

<!ATTLIST repl
   quote (true | false) "false"
>





