Section1.1Structure of an MBX book¶ permalink
Any sizable work should be broken into chapter or section chunks to avoid overly long files. A basic top level file might look something like this:
\(\begin{verbatim} <?xml version="1.0" encoding="UTF-8"?> <mathbook xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en-US"> \<xi:include href="./bookinfo.xml" /\> <!--ISBN, website, other metadata --> <book xml:id="uml-mbx"> <title>My Text</title> <subtitle>A Theory of Everything</subtitle> <xi:include href="./frontmatter.xml" /> <xi:include href="./chapter1.xml" /> <xi:include href="./chapter2.xml" /> <xi:include href="./etc.xml" /> </book> </mathbook> \end{verbatim}\)
The first line should appear as the first line of all files. Otherwise the "includes" within the book tags are dropped into the files in the order in which they are listed. Each chapter might have structure something like what follows, with a file for each section. If chapters are relatively short (as with this document) they might be contained within a single file.
\(\begin{verbatim} <?xml version="1.0" encoding="UTF-8"?> <chapter xml:id="chapter1" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>My First Chapter</title> <introduction><p>This is what's in the chapter...</p></introduction> <xi:include href="./section1a.xml" /> <xi:include href="./section1b.xml" /> <xi:include href="./section1c.xml" /> <xi:include href="./exercises1.xml" /> </chapter> \end{verbatim}\)
Then a section would look like this: \(\begin{verbatim} <?xml version="1.0" encoding="UTF-8"?> <section xml:id="section1a"><title>First Topic of Chapter 1</title> <introduction><p>This is what's in this section (optional)...</p></introduction> <!-- various content elements go here. --> </section> \end{verbatim}\)
We're now finally down to the level of content. In subsequent chapters, we will describe the basic structures of these elements. Among the items we might see in any section are
Further structural elements with subsection and subsubsection tags.
Definitions, with the definition tag.
Examples, with the example tag.
Theorems, with the theorem tag.
Figures, with the figure tag.
Sage cells, with the sage tag.
In mathematics, this is just about all you need, but XML allows for unlimited possible structures that are in common use in science, engineering or even the arts. For example, I've read that there is likely to be a molecule tag in the near future.