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.

Shuttleworth Flash Grant

I’ve been working some the past year or so with Kathi Fletcher and especially in connection with her projects at the OER-PUB group. Kathi is a Shuttleworth Fellow and recently nominated me for a Shuttleworth Flash Grant. You would think an application would be in order. Nope, apparently Kathi’s support is enough. Done, grant awarded. Fantastic! Thanks Kathi, and Shuttleworth Foundation, for the vote of confidence.

Better yet, the grant conditions do not include any kind of official reporting. When does this ever happen? I am expected to use the Shuttleworth logo (see sidebar), plus “We ask you to live openly, tell us and the world what you have done with the money” and “Share with the world how you used this award to bring your idea forward.” So I will be using posts here to communicate progress, and likely have a project page on the Sage wiki.

Initial details on grant activities in another post shortly.

Hack-the-Book

On Monday night (October 29) about 20 UPS students took me up on the offer to help crowd-source editing the latest version of my linear algebra textbook.  I have converted my LaTeX source to XML (more on that later) and despite making the conversion highly automated there are still errors in the resulting HTML version.  My Math 290 students have been champions at rooting out the errors.

I plan to make a physical hardcover print edition, so I want to make it as error-free as possible before committing to print copies!  So I had pizzas delivered and promised a raffle for the eventual hardcover print edition.  For each section reviewed, a student could add an entry to the hat full of raffle tickets.  The eventual winner was Hunter Wills (that’s him in the upper right corner).

Student Copy Editors

Most students stayed for an hour or two and in total we covered about two-thirds of the sections, with some receiving two looks.  They seemed to do an excellent job, and now I have a huge pile of corrections to make.

African Institute of Mathematical Sciences, 2012

I am at the African Institute of Mathematical Sciences this January, in Muizenberg, South Africa (near Capetown).  I am teaching a 3-week course on Algebraic Graph Theory.  I thought I might use this vehicle for some regular travel news, but now my trip is half-done and this is the first post.

Nothing too extraordinary to report.  Course is going well.  It has been good to be back and renew old acquaintances (staff and alumni), as well as meet and work with the new students.  I’ve been on two hikes so far, an afternoon trip up nearby 500-meter Muizenberg Peak, and the other an epic day-long walk across a wide swath of Table Mountain National Park.

Some photos follow – let me know if you’d like to see more.

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