MathBook: An XML Application

A specification for XML tags and stylesheets to create usable output.

Shuttleworth Funded

Rob Beezer, [email protected]

Design Goals:

  1. Simple for authors to use - no more complicated logically than LaTeX
  2. Capture the structure of writing about mathematics and Sage
  3. Processing into a variety of formats
  4. A limited number of rational tags, with simple names
  5. Minimal use of external shell scripts
  6. XSLT 1.0 compatible: ideally the only required tool is xsltproc

Output Formats:

  1. HTML web pages, enhanced with MathJax, Sage Cell server, knowls

  2. LaTeX input to create PDFs and print with pdflatex

  3. Doctesting of Sage code examples
  4. E-Books, once technically feasible
  5. Maybe a DocBook representation for conversion to other outputs

Examples

  1. A short sample article: XML Source-Author Format HTML Output PDF Output

  2. A skeletal mock book: XML Source-Author Format HTML Output PDF Output

Project Status:

Commentary

High-level commentary is recorded on my blog.

Implemented Features

Files and Examples

Updated: June 28, 2013

Easiest: it would be nice if you could view the source file (calculus-article.xml) by opening it in a web browser with the stylesheet (article-html.xsl) in the same directory. This did work on some browsers, and not on others. I've added enough nontrivial features now that this is not working in Firefox.

Easy: Look at the XHTML Output. MathJax does the math, Sage Cell Server does the code, knowls do the citations. Use the following command and files below to create XHTML output and view in your browser by opening the output file.

xsltproc article-html.xsl calculus-article.xml > calculus-article.html

Alternate: Look at the PDF Output, which comes from the same source. Issue the following to produce.

xsltproc article-latex.xsl calculus-article.xml > calculus-article.tex
pdflatex calculus-article.tex

Advanced: create a Sage Cloud worksheet from the same source. I have this working in the lab. Posted soon.

Files: Use your browser to save these files locally, do not simply click on them. If you are an author, the only file you need to understand is the first one, the XML source.

  1. Example XML source document

  2. XSL transform to LaTeX

  3. XSL transform to XHTML

  4. FreeBSD documentation CSS

  5. MathBook CSS

To Do

Other Projects