Skip to main content

Section 44.13 pretext/pretext Capabilities

Again, the command pretext -h will remind you of the various options for the script and is the most likely list to be correct and up-to-date. The following is a brief summary, in general terms, of what is possible.

Complete Conversions

With -c all and various choices of the format (-f) the script will execute a complete conversion. In some cases, this is a convenience compated with just using the xsltproc processor. In other cases the conversion is very complex and multiple (arcane) output files must be packaged up in very specific ways and no author would want to manage it all. Conversion to EPUB is one example ([provisional cross-reference: epub conversion]).


has a variety of languages for specifying images, such as xypic, pgfplots, and TikZ. By including the necessary packages or setup commands in docinfo/latex-preamble, these can all be generated at once, in the manner of the example earlier.


Images described by the Asymptote language can be processed in a manner entirely similar to that for images described with graphics languages. By default an online server will be used for the image generation, or you may elect to use an asy executable on your system and locatable via the pretext.cfg configuration file.

Sage Plot

If you have a version of Sage installed on your system, you can specify the path to the executable and obtain images described by Sage code. See the sample article for more information.

All Formats

If you desire images in a wide variety of formats, the option -f all will oblige.

YouTube Thumbnails

For each YouTube video (or itemized playlist) you specify, the script will go the YouTube site and grab a thumbnail image for that video (or first video from the itemized playlist). These get used in static formats, such as PDF.

Mathematics Representations

Conversions to EPUB, braille, and other formats require creating conversions of mathematics elements locally as part of the conversion. This requires having MathJax installed locally, see Appendix F. Structured files of these representations can be obtained by setting the component with -c math. Possible formats (-f) are svg, mml (MathML), braille and speech.


Various conversions of WeBWorK problems are facilitated through communication with a WeBWorK server. This server is specified as an argument to the -s option. See Chapter 7 for the details of this procedure.