This repository is designed to help you quickly get started with PreTeXt by launching a GitHub Codespace. The following steps will guide you through building and deploying your PreTeXt project.
There are two easy ways to set up your own PreTeXt-enabled Codespace:
-
Click "Fork" (top-right) to copy it to your GitHub account.
-
Open your new forked repository and click "Code" → "Create codespace on main".
- Create a new GitHub repository in your account.
- Copy the entirity of
.devcontainer/
,.github/
,.gitignore
,requirements.txt
folder from fragandi/CURITutorialDevelopment2025. - (Recommended) Also copy the following for a smoother experience:
- The
README_images/
folder andREADME.md
file (for guidance and troubleshooting)
- The
- Push your changes and create a Codespace from the repository.
This option gives you more flexibility to customize your setup while keeping the essential PreTeXt environment.
Once the Codespace has finished creating, check that PreTeXt is installed by running:
pretext --version
If you see an error like command not found, follow these steps:
-
Reload the VS Code Window
- Press
Ctrl+Shift+P
→ typeReload Window
→ hit Enter.
- Press
-
Kill the Existing Terminal (if open)
- Click the trash icon in the terminal panel or run
Terminal: Kill Terminal
from the command palette.
- Click the trash icon in the terminal panel or run
-
Open a New Terminal
- Press `Ctrl+Shift+`` (backtick) or go to Terminal → New Terminal.
-
Build the Project
- Run:
pretext build web
- Run:
-
Preview with CodeChat
- Use CodeChat for live preview:
codechat serve
- Use CodeChat for live preview:
-
Deploy to GitHub Pages
- Run:
pretext deploy --pages
- Deployment will also be triggered when changes are pushed to the default (main) branch.
- If you encounter that github pages is not being deployed follow the instruction below:
- Run:
Make sure to configure GitHub Pages to use GitHub Actions as the build and deployment source:
- Go to your repository’s Settings → Pages.
- Under Build and deployment, set the source to GitHub Actions.
Go to your repository Settings → Environments → click on github-pages
, and make sure it looks similar to the following:
Deployment usually takes about 4 minutes. After triggering the deployment, wait a few minutes and then visit your GitHub Pages URL.