Skip to main content

The PreTeXt Guide

Section 5.1 Options for Processing

There are currently three supported options for converting (processing) your source:
  1. The PreTeXt-CLI: very easy and friendly, but somewhat limited in customization. Requires Python 3.8 or later. Documentation appears in Section 5.2, and throughout the Guide as needed.
  2. The PreTeXt script (sometimes referred to as pretext/pretext): a Python script that has a large variety of utilities to process your source and its components. Requires Python 3.6 or later. This script is very useful for development and for users who prefer a “Swiss Army Knife” approach to their tools. In rare cases this may be needed to test new features that have not yet been exposed in the PreTeXt-CLI. See Chapter 47.
  3. xsltproc: an executable program that directly converts XML using a specified XSL file. The command-line program is easily available on Linux and MacOS, but harder to install on Windows (using Windows Subsystem for Linux is probably your best bet). Demonstrations of use in this Guide are being phased-out but will be collected in Chapter 46.
The PreTeXt-CLI, can be installed on the command-line using the command pip install pretext, see Section 5.2. To use options 2 and 3 above, you will need to get a copy of PreTeXt from its GitHub repository
 1 
github.com/PreTeXtBook/pretext
. This can be done using the command git clone https://github.com/PreTeXtBook/pretext.git, or by downloading a zip file directly from the repository.
Wherever the functionality of the PreTeXt-CLI allows it, instructions in this guide will use that method. We will collect corresponding processing instructions using xsltproc in Chapter 46. Information on the use of the PreTeXt script can be found in Chapter 47. These tools are especially useful when developing new features for PreTeXt, so they are housed in the Developer’s Guide.
If you prefer to use online, cloud-based tools, all of the processing options are available when using a Github Codespace or similar online platform. If you already use and have a license for CoCalc, it should have all the tools ready to go (although you will likely want to update the CLI).