<!ENTITY nbsp "&#xA0;">
<!ENTITY money "&#xA4;">
<!ENTITY zwsp "&#x200B;">

<!ENTITY % ULStyle "(disc|square|circle)">
<!ENTITY % Number "CDATA">
<!ENTITY % LIStyle "CDATA">
<!ENTITY % OLStyle "CDATA">

<!ENTITY % counters "(i|I|1|a|A)">
<!ENTITY % special.basic "br | span | newpage">
<!ENTITY % special "%special.basic;">
<!ENTITY % fontstyle.extra "big | small | font | basefont">
<!ENTITY % fontstyle.basic "tt | i | b | u | s | strike ">
<!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;">
<!ENTITY % inlinelogo "btex | tex | latex">
<!ENTITY % textdecor "emph | itemname | targetname">
<!ENTITY % vars "v | veun | vneun | vi | vga | veul | vreul | vwa | vgwa | vro | veuro">
<!ENTITY % inline "a | %special; | %fontstyle; | code | bucks | %inlinelogo; | index | %vars; | %textdecor;">
<!ENTITY % inline.meta "a | %special.basic; | %inlinelogo;">
<!ENTITY % Inline "(#PCDATA | %inline;)*">
<!ENTITY % Inline.meta "(#PCDATA | %inline.meta;)*">
<!ENTITY % Text "CDATA">
<!ENTITY % TextAlign "align (left|center|right|justify) #IMPLIED">
<!ENTITY % HeadingAttr
"hide CDATA #IMPLIED
 alt %Text; #IMPLIED">
<!ENTITY % pre.content
        "(#PCDATA | a | %special.basic; | %fontstyle.basic;)*">

<!ENTITY % BTeXcover "cover (hardcover|none) #IMPLIED">
<!ENTITY % BTeXinner "inner (standard) #IMPLIED">
<!ENTITY % BTeXpapersize "papersize (standard) #IMPLIED">
<!ENTITY % BTeXdefs "defs (mail|giro|examination) #IMPLIED">

<!ENTITY % Countable
"type %counters; #IMPLIED
 start %Number; #IMPLIED">

<!ENTITY % id-only "id CDATA #REQUIRED">
<!ENTITY % varattr
"id CDATA #IMPLIED
 fromgame CDATA #IMPLIED">
<!ENTITY % key-value
"key CDATA #REQUIRED
 value CDATA #REQUIRED">
<!ENTITY % imgAttrs
"src CDATA #IMPLIED
 fromgame CDATA #IMPLIED
 gameitem CDATA #IMPLIED
 itemimg CDATA #IMPLIED
 caption %Text; #IMPLIED
 height %Number; #REQUIRED">
<!ENTITY % coreattrs
"id          CDATA             #IMPLIED
 class       CDATA          #IMPLIED
 title       %Text;         #IMPLIED">

<!ENTITY % attrs "%coreattrs;">

<!ENTITY % heading "part | chapter | section | subsection">
<!ENTITY % lists "ul | ol">
<!ENTITY % blocktext "pre | anonbreak | callout | center | fullpagebox">
<!ENTITY % block "p | %heading; | %lists; | %blocktext; | img">
<!ENTITY % Flow "(#PCDATA | %block; | %inline;)*">

<!ELEMENT btexdoc (macrodef?,cover?,tocpage?,manuscript,indexpage?)>
<!ATTLIST btexdoc
        %BTeXcover;
        %BTeXinner;
        %BTeXpapersize;
        %BTeXdefs;
        >
<!ELEMENT macrodef (pair)*>

<!-- COVER tag specification -->
<!ELEMENT cover (title?,subtitle?,author?,edition?)>
<!ELEMENT title %Inline.meta;>
<!ELEMENT subtitle %Inline.meta;>
<!ELEMENT author %Inline.meta;>
<!ELEMENT edition %Inline.meta;>

<!-- TOC-like tag specification -->
<!ELEMENT tocpage (tableofcontents)>
<!ATTLIST tocpage title %Text; #IMPLIED>
<!ELEMENT indexpage (tableofindices)>
<!ATTLIST indexpage title %Text; #IMPLIED>

<!-- MANUSCRIPT tag specification -->
<!ELEMENT manuscript %Flow;>
<!ELEMENT fullpagebox %Flow;>
<!ELEMENT callout %Inline;>
<!ATTLIST callout %attrs; %TextAlign;>

<!ELEMENT part %Inline;>
<!ATTLIST part
        %HeadingAttr;
        %Countable;
        >
<!ELEMENT chapter %Inline;>
<!ATTLIST chapter %HeadingAttr; %Countable;>
<!ELEMENT section %Inline;>
<!ATTLIST section %HeadingAttr; %Countable;>
<!ELEMENT subsection %Inline;>
<!ATTLIST subsection %HeadingAttr; %Countable;>


<!-- self-closing tags -->
<!ELEMENT tableofcontents EMPTY>
<!ELEMENT tableofindices EMPTY>
<!ELEMENT anonbreak EMPTY>
<!ELEMENT newpage EMPTY>
<!ELEMENT btex EMPTY>
<!ELEMENT latex EMPTY>
<!ELEMENT tex EMPTY>
<!ELEMENT pair EMPTY>
<!ATTLIST pair %key-value;>
<!ELEMENT index EMPTY>
<!ATTLIST index %id-only;>
<!ELEMENT img EMPTY>
<!ATTLIST img %imgAttrs;>

<!-- inherited from HTML -->
<!ELEMENT p %Inline;>
<!ATTLIST p %attrs; %TextAlign;>
<!ELEMENT i %Inline;> <!-- how should I style this? CAPS? ALLCAPS? -->
<!ATTLIST i %attrs; %TextAlign;>
<!ELEMENT span %Inline;>
<!ATTLIST span
        %attrs;
        color %Text; #IMPLIED
        colour %Text; #IMPLIED
        >
<!ELEMENT emph %Inline;>
<!ELEMENT itemname %Inline;>
<!ELEMENT targetname %Inline;>
<!ELEMENT code %pre.content;>
<!ELEMENT bucks %Inline;>
<!ELEMENT br EMPTY>
<!ELEMENT ul (li)+>
<!ATTLIST ul
        %attrs;
        type        %ULStyle;     #IMPLIED
        compact     (compact)     #IMPLIED
        >
<!ELEMENT ol (li)+>
<!ATTLIST ol
        %attrs;
        %Countable;
        >
<!ELEMENT li %Flow;>
<!ATTLIST li
        %attrs;
        type        %LIStyle;      #IMPLIED
        value       %Number;       #IMPLIED
        >
<!ENTITY % a.content
        "(#PCDATA | %special; | %fontstyle; | code | var)*">
<!ELEMENT a %a.content;>
<!ATTLIST a
        href CDATA #REQUIRED
        >

<!-- var tags -->
<!ELEMENT v EMPTY>
<!ATTLIST v %varattr;>
<!-- regular josa -->
<!ELEMENT veun EMPTY>
<!ATTLIST veun %varattr;>
<!ELEMENT vneun EMPTY>
<!ATTLIST vneun %varattr;>
<!ELEMENT vi EMPTY>
<!ATTLIST vi %varattr;>
<!ELEMENT vga EMPTY>
<!ATTLIST vga %varattr;>
<!ELEMENT veul EMPTY>
<!ATTLIST veul %varattr;>
<!ELEMENT vreul EMPTY>
<!ATTLIST vreul %varattr;>
<!ELEMENT vwa EMPTY>
<!ATTLIST vwa %varattr;>
<!ELEMENT vgwa EMPTY>
<!ATTLIST vgwa %varattr;>
<!-- irregular josa -->
<!ELEMENT vro EMPTY>
<!ATTLIST vro %varattr;>
<!ELEMENT veuro EMPTY>
<!ATTLIST veuro %varattr;>
