Summer Progress on MathBook XML

I’ve made a lot of progress this summer on the XML application I have been developing. A better way to describe what I am building is a practical way for authors to create reports, articles and books with the structure explicitly defined, and with no presentation assumed. This will allow for faithful conversions to a variety of formats, and possibly with a variety of sensible options for presentation.

I have been most productive while writing such documents at the same time as I have been developing the application. Here is an example. I have submitted a short note to the American Mathematical Monthly. Authored with MathBook XML, it has been rendered as both a PDF and as a web page.

For the moment, I am trying to have the HTML rendering mimic whatever default rendering you would get from default LaTeX. But you will notice that the HTML version uses knowls for citations. As the HTML rendering evolves, expect it to take even greater advantage of the capabilities of browsers.

I have made a lot of progess with cross-references, including automatic numbering of displayed equations with MathJax. There is minimal support for bibliographic records. Figures and images are supported. A unified approach to tables will have to wait a bit. The CSS for the HTML is functional, but has lots more potential, especially for internationalization. Next I am going to tackle a book-length project that has lots of Sage code (so will make a doctesting framework).

An XML Application for Mathematics

Some high-level thoughts about a MathBook XML application. I am building an XML vocabulary which I hope will make possible

  • relatively painless authoring in XML for for mathematician-authors
  • capturing the full structure of scholarly documenst about mathematics
  • providing a wide variety of output formats accurately reflecting the content

To do this, I plan to

  • keep the number of tags and options to a minimum
  • resist too much customization, and resist customizing too much of the presentation
  • use simple processing tools, such as xsltproc on XSLT 1.0 features

Specifics and progress will be reported and updated on a project page at the Sage wiki. Priorities for new features will be based on requests. I’ll blog here on less technical aspects of the project.

The Case for an XML Application

This is the first of two introductory posts about my project supported by my Shuttleworth Flash Grant.  Rationale and motivation here, vague/concrete plan next.

Mathematics or not, I am convinced of the value of capturing scholarly documents in a structured form.  If you wish to have a variety of outputs for your writing, such as print, PDF, HTML web pages, and e-books, then it is a must.

Consider two very different scenarios.  First, when you place a bold typeface to a word, what do you really mean?  Is it emphasis, or perhaps a defined term?  Especially in an electronic medium (see output formats in the previous paragraph), you might wish to handle the two situations differently.  The emphasis could be bold in print, or colored red in an electronic version.  The defined term might be a hyperlink or pop-up window or knowl in the electronic version.  You might begin to see that authoring in a “word processor” is the exact opposite of what I am advocating.

Second, suppose you write in LaTeX. How do you know a subsubsection has ended?  Only when you encounter the start of another subsubsection, or the start of a new subsection, or the start of a new section, or the start of the chapter exercises, or the start of a new chapter, or the start of a new part (a major subdivision of a book), or the end of the book.  It can be a nightmare to process all these conditions in an automated way (see output formats in the previous paragraph), when LaTeX does not require a marker for the end of subdivisions like this.  Many people like to say LaTeX separates structure from presentation, but you can very quickly see this is a false promise, and is routinely violated by authors.

XML (eXtensible Markup Language) is an extremely simple language for describing the structure of text.  It is hierarchical (tree-like structure), and a begin is always accompanied by an end, like any structured programming language.  The vocabulary (“elements” and “attributes”) can be anything you like.  The output can be any format.  For example, you can create LaTeX as output (and then use standard programs to convert to PDF).  The power comes through the transformation language XSL (eXtensible Stylesheet Language) which is often called XSLT (T=Transform).  This is not an easy language to understand or learn.  But an author need only write with an accepted vocabulary and let an existing transform do the conversion.  The hard technical details of the output language can be captured in the transform.  A set of elements, their relationships, and the resulting transforms, are together called an XML application.  (X)HTML is an example of an XML vocabulary.

Case in point.  Summer and fall of 2012, I converted the semi-structured LaTeX source of my linear algebra textbook to an ad-hoc set of tags.  The resulting XSL transformation produced the online version.  None of this is very reusable, and I have not released the transforms publicly.  They should not interest most authors.  The source should be of interest (it is not perfect, but is reasonable) and the outputs, such as the online and print versions, should be the demonstration of the power of XML source converting to two very different formats via an XSL transform.

So I see real utility in creating an XML application for authors of writings about mathematics, with a special interest to allow writing about compuational tools, specifically Sage.  An author could adopt this approach, but any mathematician who can write in LaTeX already has the mindset to use a markup lanuguage rather than a word processor.  More in the next post about design requirements and my plans.  If you cannot wait, head over to the project page.

Combinatorial Potlatch 2011

The 2011 edition of the Combinatorial Potlatch was yesterday at Seattle University, which I organized along with Nancy Neudauer.  David Neel handled all of the local arrangements.

William Stein gave an overview of Sage, with some combinatorial tidbits.  There were the usual “oohs” and “aahs” when he generated a random matrix and then produced its LaTeX code in one extra step.  Josh Laison gave a very nice talk on obstacle numbers of graphs with great visuals and an on-the-fly clicker change in mid-talk.  Peter Winkler wrapped up with more great visuals (cartoons, almost!) for an entertaining talk about a cop pursuing a drunk on a graph.

It was nice to see some new faces, such as Shannon Overbay over from Spokane, and some regulars from farther afield, such as John Gimbel down from Alaska.

I never have any graduate students to supervise, but many of my students go on to a graduate degree.  Sometimes they even get their PhD in combinatorics. And both were present for the Potlatch.  David Neel took the UPS combinatorics course the first time it was offered and studied under Bogart at Dartmouth, while Jane Butterfield did a summer research project with me and is finishing up her thesis in graph theory at the University of Illinois.  Photo below, and more from the conference are here.

Neel, Beezer, Butterfield

David Neel, Rob Beezer, Jane Butterfield, Seattle, Nov 19, 2011

When is Free not Free? (Part 1)

A textbook posted on the Internet that is “free to download” does not have any inherent freedoms.  The author has a copyright and may at any time restrict your ability to make copies.  You have no right to make corrections and distribute that corrected copy.  Caveat emptor.

An example.  Today a Google search on “linear algebra” turns up many interesting resources.  On the second page of results we find a textbook “Applied Linear Algebra and Matrix Analysis” by Thomas S. Shores.  It would appear the book was once available to download.  Now the page says:

Welcome again. In order to enable prospective users to preview my text easily and conveniently, in the past I have put a copy of it on the web for your perusal. In the last few years I’ve received many helpful comments and appreciative notes for having done so. I would like to thank those of you who sent me these notes and comments. You have helped me substantially improve the text. I am now under contract with Springer-Verlag and the book has been published in their Undergraduate Texts in Mathematics series in hardbound and, more recently, soft cover editions. Therefore, I have removed the on-line copy. I will leave the table of contents below for informational purposes, along with errata sheets for the each version of the textbook.

So it is important to understand the difference between “free” (as in no cost) and “freedom” (free to copy, free to modify, etc, as provided in an open license).

See for yourself:  Book Site, Archived Page Capture


This blog will mostly be a place to publish my thoughts about open source textbooks and open source software, especially when it comes to their use in teaching mathematics.  And maybe I will mix in some travel news when appropriate.

I know better than to suggest any kind of regular schedule.  When I have something to say, I will say it.

I am new to blogging software (WordPress) so if you see some settings that need adjusting, please let me know.