Modern Textbooks for Modern Times

Robert A. Beezer

Department of Mathematics and Computer Science
University of Puget Sound

A Short History of a Long Time

Math 290 Textbook: A First Course in Linear Algebra (FCLA)
Conceived as open-source, free to copy/modify/distribute

  • December 2003: Initiated for Spring sabbatical
  • December 2004: Reasonably complete
  • December 2006: Version 1.0
  • December 2006: (X)HTML Version
  • July 2008: jsMath Version
  • Summer/Fall 2012: Conversion to XML, full HTML version
  • May 2013: Initiated MathBook XML project

FCLA, Mark 1 (PDF, December 2006)

FCLA, Mark 2 (Pure HTML, via tex4ht, December 2006)

FCLA, Mark 3 (HTML + jsMath library, July 2008)

FCLA, Mark 4 (One-off XML, Summer/Fall 2012)

A Long History of a Short Time

  • 2010-14: National Science Foundation Undergraduate Education Grant
    • UTMOST: Undergraduate Teaching of Mathematics with Open Software and Textbooks
    • William Stein (UW): Sage, SageMathCloud
    • Jason Grout + Students (Drake University): Sage Cell
    • Tom Judson (UPS - 2000): Abstract Algebra textbook
    • David Farmer (AIM): Knowls, FCLA CSS
    • Kiran Kedlaya
    • RAB: Converted FCLA to Sage Notebooks via tex4ht
  • May 2013: Shuttleworth Foundation Flash Grant
    • MathBook XML project

Structured Scholarly Documents

A textbook (esp. in mathematics) is a highly structured document:

  • Chapter, Section, Subsection (e.g. Subsection 2.3.8)
  • Theorem, Lemma, (w/ Proof), Definition (e.g. Axiom 5.17)
  • Table and Figure (e.g. Table 4.2.4)
  • Example, Remark, inline Exercise (e.g. Exercise 5.115)
  • Exercise sections (per chapter, per section, etc.?)
  • Bibliography (one, or per chapter?) (e.g. [3, Theorem 6])
  • Equation (e.g. Equation (5.2.3))

Organization of a Printed Book

Generated Content

Navigation

  • Table of Contents
  • Index
  • Numbering (hierachical)

Extras

  • Notation List
  • Hints, Solutions for Exercises
  • List of Figures, etc.

How does this all change online (HTML)?

Hierarchy of a Structured Document

  • A printed book presents a linear, or depth-first search, version of the structure
  • HTML allows expressing the tree structure with multiple pages, enhanced navigation

Image from interactivepython.org

eXstensible Markup Language (XML)

  • Express data (sentences, words) in a hierarchy
  • “eXtensible” — can define new elements (“tags”)
  • Simple syntax, very few reserved characters
    (ampersand is the worst)
  • XML does not have to be ugly!
    (bad reputation: data exchange, automated production)

MathBook XML is a new “XML application” for structured documents (with mathematics documents described first)

Simple MathBook XML Example

<book>
	<title>A First Course in Linear Algebra</title>
	<chapter>
		<title>Systems of Linear Equations</title>
		<section>
			<title>Reduced Row Echelon Form</title>
			<p>When analyzing systems of equations...</p>
		</section>
		<section>
			<title>Homogeneous Systems</title>
			<p>The special case of ...</p>
		</section>
	</chapter>
</book>

MathBook XML Goals

  • Design a presentation-neutral XML specification
  • Allow for conversion to a variety of outputs:
    • \(\LaTeX\), then to PDF/print (safety net)
    • HTML, tree of webpages
    • Sage Notebooks, iPython notebooks, SageMathCloud worksheets
    • EPUB (ebooks for ereaders)
    • Whatever may come next
  • Easy and natural for authors to use
  • Converters demonstrate feasibility (reference design)

Mathematics in Mathbook XML

  • “\(\LaTeX\) is great between the dollar signs”
  • \(\LaTeX\) in <m>, <me>, <md>+<mrow> elements
  • Pass-through to \(\LaTeX\) output
  • Configure MathJax JavaScript library for HTML output

The Cauchy-Bunyakovsky-Schwarz Inequality:\[\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)\]

MathJax Demonstration Page

Tyler Ueltschi's Math 420 Research Project (Spring 2014)

JavaScript Widgets

  • Knowls — collapsible snippets of text, fully supported
  • Google Fonts — in use
  • Google Code Prettifier — for static program listings
  • Sage Cell — program execution, fully implemented
  • GeoGebra — Geometry canvas/playground (needs work)
  • Video, Audio players — video partially implemented
  • WeBWorK online homework — feasible
  • Skulpt: in-browser Python execution — feasible

A WeBWorK Homework Problem

Sample Structured Theorem

<theorem xml:id="theorem-finite-extension">
<statement>
	<p>Every finite extension field <m>E</m> of a field 
	   <m>F</m> is an algebraic extension.</p>
</statement>
<proof>
	<p>Let <m>\alpha \in E</m>....</p>
</proof>
/theorem>

Tom Judson's “Abstract Algebra: Theory and Applications”

  • Recently converted to XML from \(\LaTeX\) (nearly done)
    • Text, Conversion: Tom Judson
    • Production, Conversion: RAB
    • HTML and CSS design: David Farmer
    • CSS and JavaScript implementation: Michael DuBois, UPS '14
  • Improving the \(\LaTeX\), HTML and Sage Notebook conversions
  • Link

To Do, Questions

  • Conversion to SageMathCloud, iPython worksheets
  • EPUB — MathJax now makes good scalable SVG's
  • Compile xsltproc for Windows?
  • Lists and tables need work
  • Static versions of dynamic elements?
  • Slideshows?

Meta Slide

<slide>
	<title>To Do, Questions</title>
	<ul>
		<li>Conversion to SageMathCloud, iPython worksheets</li>
		<li>EPUB <mdash /> MathJax now makes <em>good</em>
		    scalable SVG's</li>
		<li>Compile <c>xsltproc</c> for Windows?</li>
		<li>Lists and tables need work</li>
		<li>Static versions of dynamic elements?</li>
		<li>Slideshows?</li>
	</ul>
</slide>

Resources

Thanks for listening!