Subsection3.1What is PreTeXt?
PreTeXt allows you to write (and prepare for distribution) free online technical texts. The motto is “Write once, read anywhere”.
More technically PTX is a computer application which allows using files of ‘markup’ similar to LaTeX, HTML or Markdown to be processed into various output formats, such as:
At this point I must admit that I can't say this as well as the lead developer of PTX, Rob Beezer of the University of Puget Sound. Last year he gave the invited talk for WEBSIGMAA, which you might enjoy Googling for.
Crucially, your source for PTX is just a bunch of text files:
They must be highly structured, as XML (eXtensible Markup Language)
The structure is all that matters; PTX provides all the presentation for you at no extra charge!
We will see a lot of examples of this throughout. Here is a sample. (See the handout/“cheatsheet” for many more.)
<section xml:id="section-why-ptx">
<title>Why PreTeXt?</title>
<introduction><p>Now let's dive into why we should work with
<init>PTX</init>.</p></introduction>
<subsection>
<title>What is PreTeXt?</title>
<p>PreTeXt<fn>Usually <init>PTX</init></fn> allows you
to write (and prepare for distribution) free online technical texts.
The motto is <q>Write once, read anywhere</q>.</p>
<p>More technically, <init>PTX</init> is a computer application
which allows using files of <sq>markup</sq> similar to <latex />,
HTML or Markdown to be processed into various output formats, such as:
<ul><li><p>Linked html pages</p><li>
<li><p>pdf generated using <latex /></p></li>
<li><p>Notebooks in computer/programming worksheet format</p></li>
<li><p>ePub, even more outputs<p></li></p>
Finally, PTX supports any LaTeX that MathJax supports, which is to say most things you want in a mathematics text.
Big Ecosystem
There are a number of related projects out there; everything from Geogebra Books, R bookdown, to Ximera (the latter is the subject of the WEBSIGMAA talk this year). It's important to remember we're focusing on “Why PTX?”, not “Why not other open authoring tools?” Ideally, there would be enough different authors of open educational resources to support all of the open source tools in the ecosystem.
Subsection3.2Why use PTX – technology
There are three pieces of technology which make PTX an ideal authoring tool for mathematics. Two will not surprise you, but perhaps the third will.
With the internet now ubiquitous, we want a tool which allows full use of its powers (without giving up on print).
Computation is becoming more and more machine-driven and done, so we want to fully support this within the text – both for the math and for checking homework. (See Keith Devlin's recent op-ed about a related issue.)
Most likely, you are a mathematician, not a design professional nor a typesetting or cross-platform UI expert. Your authoring tool should take care of this for you, as much as possible.
The most important takeaway from this is that PTX allows you to separate content from presentation. Repeat this after me!
This is true both in practical matters (why hard-code in cross-references?) but also in the more abstract design philosophy. Let's see examples of all of these.
Example3.1
First, it is hopefully already evident that the internet is useful for PTX. Indeed, I rely on it for processing any mathematical markup, like
\begin{equation*}
\int_0^\infty e^{-x}\, dx\neq 2018
\end{equation*}
Many of you will be familiar with MathJax, sponsored by the MAA, among others. However, we also rely on it for various cross-references, like to one of the gallery of examples we'll soon see, [10.1].
One of the most popular parts of this, due to Harald Schilly, is the knowl. This is easier to demonstrate than to define. We just saw one, here is another.
Theorem3.2My theorem
The Riemann Hypothesis is true.
Proof
In terms of computation, there are two main types of embedded interaction. One can use Sage to verify (or not) computations, among other things:
But it is now also possible to integrate WeBWorK problems, provided you have a server willing to accommodate you. The sample WeBWorK chapter has lots of nice examples.
What about design? Here are things I appreciate that PTX does (or can do) for me so I don't have to know about it.
My LaTeX pdf output looks pretty much as it is on-screen. (There are some issues with unusual character sets, like Cyrillic.)
I bet most of us are using laptops. I bet most of our students aren't. But the web version of everything scales nicely regardless of mobile device. Shall we try?
Changing design or color scheme is something you can try out; similarly, gutter widths, characters per line, etc. are handled other than by you or the LaTeX default.
I know the PTX developers will take accessibility issues into account, so I don't have to.
This is a small subset of what the technology enables, but I will stop here for now.
Subsection3.3Why use PTX – freedom
PreTeXt is important for another reason – freedom. Here are some of the freedoms that PTX gives us, as textbook authors or consumers.
If you use an PTX book, you may free yourself from the relentless upgrade cycle of commercial publishers. Here is the estimate of student savings (around $100,000) from one text which has just converted to PTX. Naturally, there are also savings in terms of annoyance of trying to find older editions so your syllabi aren't constantly changing …
If you write an PTX book, you are free to write the mathematics, not focus on distribution. How many free textbooks start but never make it further than the first stage?
PTX allows you to make the best use of free tools like Sage, WeBWorK, LaTeX, and many others.
Perhaps most importantly, PTX supports your ability to free your text from yourself. For now, many of us wish to retain creative control; but what happens upon retirement, changing institutions, etc.? Because the source for your text is in clear, structured files, you can allow others to submit change requests. Here is a non-PTX example of a highly-regarded text accepting such requests.
Whether you choose a restrictive license from Creative Commons keeping full control, or go all the way to allowing total remixing with a GPL or even public domain license, having the source in this form makes things easy to collaborate.