MathBook: An XML Application

A specification for XML tags and stylesheets to create mathematical content that yields 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 semi-unusual required tool is xsltproc

Output Formats:

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

  2. LaTeX input as precursor of PDF output via pdflatex for print

  3. Doctesting of Sage code examples for quality assurance
  4. Sage Worksheets (Sage Notebook, Sage Math Cloud)
  5. E-Books, once technically feasible
  6. Maybe a DocBook representation for conversion to other outputs and future-proofing

Project Status:

Examples (Updated 2013/08/23)

  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>

Commentary

High-level commentary is recorded on my blog.

Implemented Features

Files and Commands, the nitty-gritty

Updated: June 29, 2013

Prerequisites: xsltproc is in most Linux distributions and on Mac OS as a command-line executable. Information on Windows availablity would be helpful - please write. You'll need TeX to run pdflatex. You can author if you also have a text editor and a browser - that is all you need.

HTML output: MathJax does the math, Sage Cell Server does the code, knowls do the citations. Use the following command and files below to create (X)HTML output and view in your browser by opening the output file.

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

PDF: Same XML source file. Use a different XSLT file to process. View PDF as you please. Issue the following to produce.

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

More: repeat above with the mock book, graph-theory-book.xml, linked above.

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. The XSL files can be scary - not critical for an author to understand them. You'll want the CSS to render any HTML you produce.

  1. XSL transform to HTML

  2. XSL transform to LaTeX

  3. MathBook CSS

To Do (unprioritized)

Other Projects