# 3 BNF Description of the DTD

This description is a simplified idealization of the DTD. It provides an intuitive overview of the element hierarchy. Identifiers such as e. g. `TITLE` denote elements, whereas identifiers such as e. g. <TEXT or PHRASE> denote non-terminal symbols in this BNF description.

> `FOO` | ::= | `BAR` `BAZ`

means that the contents of element `FOO` must consist of a `BAR` element followed by a `BAZ` element. Whereas:

> <FOO> | ::= | `BAR` `BAZ`

means that non-terminal <FOO> can be rewritten to the sequence `BAR` `BAZ`.

The annotation `+`<INDEXING> in the rule for `BOOK` indicates that the elements represented by non-terminal <INDEXING> are allowed to occur anywhere within the scope of element `BOOK`.

> `BOOK` | ::= | `FRONT` `BODY` `BACK`? | % +<INDEXING>

> `FRONT` | ::= | `TITLE` <AUTHOR>* `META`* `ABSTRACT`?

> `BODY` | ::= | `CHAPTER`* `PART`* `APPENDIX`*

> `CHAPTER` | ::= | `TITLE`? <P>* `SECTION`*

> `SECTION` | ::= | `TITLE`? <P>* `SUBSECTION`*

> `SUBSECTION` | ::= | `TITLE`? <P>* `SUBSUBSECTION`*

> `SUBSUBSECTION` | ::= | `TITLE`? <P>*

> <P> | ::= | `P`
> | | | `PARA`
> | | | `DIV`

> `P` | ::= | <TEXT or PHRASE>*

> `PARA` | ::= | `TITLE` <TEXT or PHRASE>*

> `DIV` | ::= | `TITLE`? <P>*

> `TITLE` | ::= | <TEXT or PHRASE>*

> <TEXT or PHRASE> | ::= | <TEXT>
> | | | <PHRASE>

> `LIST` | ::= | `ITEM`*
> | | | (`ENTRY` `SYNOPSIS`? `ITEM`)*

> `ITEM` | ::= | <...P>

> `ENTRY` | ::= | <TEXT or PHRASE>*

> `SYNOPSIS` | ::= | <TEXT or PHRASE>*

> <...P> | ::= | <TEXT or PHRASE>* <P>*

> <PHRASE> | ::= | `MATH`
> | | | `MATH.EXTERN`
> | | | `MATH.CHOICE`
> | | | `PICTURE`
> | | | `PICTURE.EXTERN`
> | | | `PICTURE.CHOICE`
> | | | `CODE`
> | | | `CODE.EXTERN`
> | | | `VAR`
> | | | `REF`
> | | | `PTR`
> | | | `REF.EXTERN`
> | | | `PTR.EXTERN`
> | | | `FILE`
> | | | `KBD`
> | | | `KEY`
> | | | `SAMP`
> | | | `NAME`
> | | | `Q`
> | | | `SPAN`
> | | | `DEF`
> | | | `FIGURE`
> | | | `NOTE`
> | | | `GRAMMAR`
> | | | `GRAMMAR.RULE`
> | | | `TABLE`
> | | | `CHUNK`

> `MATH` | ::= | <TEXT>

> `MATH.EXTERN` | ::= | <EMPTY>

> `MATH.CHOICE` | ::= | (`MATH` | `MATH.EXTERN`)+

> `PICTURE` | ::= | <TEXT>

> `PICTURE.EXTERN` | ::= | <EMPTY>

> `PICTURE.CHOICE` | ::= | (`PICTURE` | `PICTURE.EXTERN`)+

> `CODE` | ::= | (<TEXT>`VAR`|`SPAN`)*

> `CODE.EXTERN` | ::= | <EMPTY>

> `VAR` | ::= | <TEXT>

> `REF` | ::= | <TEXT or PHRASE>*

> `PTR` | ::= | <EMPTY>

> `REF.EXTERN` | ::= | <TEXT or PHRASE>*

> `PTR.EXTERN` | ::= | <EMPTY>

> `FILE` | ::= | (<TEXT> | `VAR`)*

> `KBD` | ::= | <TEXT>

> `KEY` | ::= | <TEXT>

> `SAMP` | ::= | <TEXT>

> `NAME` | ::= | <TEXT>

> `Q` | ::= | <TEXT or PHRASE>*

> `SPAN` | ::= | <TEXT or PHRASE>*

> `DEF` | ::= | <TEXT or PHRASE>*

> `FIGURE` | ::= | `TITLE`? `CAPTION`? `PHRASE`* <P>*

> `CAPTION` | ::= | <...P>

> `NOTE` | ::= | <...P>

> <INDEXING> | ::= | `INDEX`

> `INDEX` | ::= | `AND`+ `SEE`?

> `AND` | ::= | <TEXT or PHRASE>*

> `SEE` | ::= | `AND`+

> `GRAMMAR` | ::= | `GRAMMAR.RULE`+

> `GRAMMAR.RULE` | ::= | `VAR` `GRAMMAR.ALT`+

> `GRAMMAR.ALT` | ::= | <TEXT or PHRASE>* `GRAMMAR.NOTE`?

> `GRAMMAR.NOTE` | ::= | <TEXT or PHRASE>*

> `TABLE` | ::= | `TITLE`? `TR`+

> `TR` | ::= | (`TD` | `TH`)+

> `TD` | ::= | <...P>

> `TR` | ::= | <...P>

> `BACK` | ::= | (`META` | `BIB.EXTERN`)*

> `BIB.EXTERN` | ::= | <EMPTY>

> `AUTHOR` | ::= | <TEXT>

> `AUTHOR.EXTERN` | ::= | <EMPTY>

> `CHUNK` | ::= | `TITLE` (<TEXT> | `CHUNK.REF`)*

> `CHUNK.REF` | ::= | <TEXT or PHRASE>*