Skip to main content

The PreTeXt Guide

Section 47.1 Running pretext/pretext

pretext is a Python program (aka script), so you will need to have the Python 3 interpreter on your system (version 3.6 or better expected as of 2021-05-21) which you can run at a command-line (aka terminal, console, command prompt). So your first step is to install Python (see Appendix C) or check your installed version and the exact name of your executable (see Section C.1).
The pretext script is located in a directory of the PreTeXt distribution also named pretext. So we often refer to it as the pretext/pretext script to avoid confusion with all the other places we say PreTeXt. As a simple check on your ability to run the script, with a suitable path you can run
/path/to/pretext/pretext -h
to get a summary of the commands. Since the command lives in the pretext directory, you may prefer to change to that directory for your first attempt. On a Unix-like system (Linux, Mac) you may need to go ./pretext since the program is not on your PATH. Thus, depending on your executable name (Section C.1), whether the script is in your path, and whether you have made the file executable, you might need to run
python /path/to/pretext/pretext -h
or
python3 /path/to/pretext/pretext -h
Some of the processing may take a long time, or you may experience trouble. There are two switches to enable more verbose output in your terminal or console.
pretext -v [command arguments]
will provide progress indicators, which may be comforting for long runs, while
pretext -vv [command arguments]
will provide progress indicators along with additional technical information that will help you or a fellow author to discern where a problem lies. If you ask for help, please include all of this output, from start to finish, including the command you use and the current directory, and do not assume you know exactly which part is the relevant part.
You have attempted of activities on this page.