Skip to main content

The PreTeXt Guide

Subsection 2.2.1 Building for web

You can build your entire project in a few different ways.
  • Click the “PreTeXt” button in the center left of the bottom toolbar of the VS Code window (see Figure 2.2.1.1). A dialog will pop up asking which PreTeXt command you want to run. Select Build to get a menu of options to select a target to build: choose web.
  • You can use the keyboard shortcut CTRL+ALT+p (replacing CTRL with CMD if you have a Mac) to get the same dialogs. Or to build in one step, use CTRL+ALT+b.
  • Select a PreTeXt command from the VS Code command pallette, which you can access by clicking the icon in the bottom left of the VS Code window. You can also access this by typing CTRL+SHIFT+p (again, replacing CTRL with CMD if you have a Mac). Start typing “pretext” to get a list of commands available.
  • If you are comfortable entering commands in a terminal/command prompt, you can access one in your Codespace using CTRL+`. Then you can run pretext build web to build your project.
The resulting HTML files will be available in the output/web directory of your project. However, to view it, you should NOT navigate there and open the files. Instead, read on.
Screenshot of VS Code PreTeXt button in Codespaces
Figure 2.2.1.1. PreTeXt commands in Codespaces