Cooking Up a Mathematica Cookbook

Sal Mangano

Into Technology Inc. / O'Reilly Media

Abstract

This presentation will cover the author's experience in writing the forthcoming O'Reilly Mathematica Cookbook using the Mathematica front-end as the authoring environment. The Mathematica front-end is the obvious environment to author a book on Mathematica because it is trivial to test example code as you write. However, most publishers will not accept documents in notebook form. In the case of O'Reilly, the author needed to convert notebooks to DocBook form. 

The presentation will contrast two approaches that the author tried. The first used Notebook export to XHTML+MathML followed by XSLT 2.0 processing step to create DocBook output. The second used Mathematica's ability to manipulate notebooks in Mathematica code itself. Excerpts from the Cookbook will be used to illustrate challenges faced while automating the conversion process. More generally, authors need to automate tasks like chapter numbering, table of contents generation, figure numbering and referencing, image export, MathML export, etc. Examples of programming these tasks at the XML level using XSLT will be contrasted with notebook level programming. 

Mathematica 6's advanced stylesheet facility was integral to the automation process and the presentation will demonstrate the value of using custom stylesheets and the subtleties of customizing them.