Skip to main content
\( \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

AppendixBAuthoring a book

Writing a book is something many of you no doubt wish to do. Articles or brief course supplements aren't always enough.

There is a good sample book on the examples page of the PTX website. I want to point out three things that will save you a lot of grief in planning this out.

  • First, there are new tags. You do not use <article>, instead you use <book> and </book> to open and close your book. Similarly, there are <chapter> tags which themselves enclose <section>s.

  • Secondly, unless you want to go crazy, modularize; once you have some sense of an overall structure, you can start splitting into multiple files. There are three things to make this work (see Section 4.2 of the Author's Guide):

    • The top tag should not just be <mathbook>, but should be <mathbook xmlns:xi="http://www.w3.org/2001/XInclude">. (Don't copy it, it's in every modular file.)

    • The beginning of each subfile should not be <chapter>, but should be <chapter xmlns:xi="http://www.w3.org/2001/XInclude">. (Don't copy it, it's in every modular file.)

    • To then include chapter-1.xml, in your main source document put <xi:include href="chapter-1.xml" /> (Don't copy it, it's in every modular file.)

    • Instead of just using xsltproc ../../xsl/mathbook-html.xsl myfile.xml, do use an extra argument xsltproc --xinclude ../../xsl/mathbook-html.xsl myfile.xml (Do copy this, it's hard to remember and of course isn't in any given file!)