A collection of math exercises I felt like writing.
Find a file
2026-01-02 13:39:09 -08:00
.github/workflows Fix hook 2026-01-02 13:20:56 -08:00
exercises/complex-numbers Initial setup 2026-01-02 13:11:43 -08:00
hooks Update to use just 2026-01-02 13:39:09 -08:00
scripts Update to use just 2026-01-02 13:39:09 -08:00
templates Initial setup 2026-01-02 13:11:43 -08:00
.gitattributes Initial setup 2026-01-02 13:11:43 -08:00
.gitignore Initial setup 2026-01-02 13:11:43 -08:00
justfile Update to use just 2026-01-02 13:39:09 -08:00
README.md Update to use just 2026-01-02 13:39:09 -08:00

Matty's Math Exercises

Math exercise sheets in Typst. PDFs are built by CI and available as GitHub artifacts/releases.

Setup

./scripts/setup.sh  # or: just setup && just check

This configures git hooks and checks for required tools (typst, typstyle, diff-pdf).

Usage

Install just (command runner):

brew install just          # macOS
apt install just            # Ubuntu
cargo install just          # via cargo
just          # list all commands
just compile  # compile all exercises
just watch    # recompile on changes
just format   # format .typ files

Watch a single file:

typst watch exercises/foo/main.typ build/foo.pdf

Structure

exercises/
  topic-name/
    main.typ        -> build/topic-name.pdf
    assets/         (optional images, etc.)
templates/
  exercise-sheet.typ
build/              (gitignored)
justfile            # command definitions

New exercise sheet

mkdir exercises/new-topic
cp templates/exercise-sheet.typ exercises/new-topic/main.typ
just compile

Visual PDF diff

just diff-pdf old.pdf new.pdf           # GUI
just diff-pdf-save old.pdf new.pdf d.pdf  # save diff

CI automatically generates visual diffs against the previous commit.

Hooks

Pre-commit hook auto-formats .typ files and compiles everything. Hooks live in hooks/ and are enabled via git config core.hooksPath hooks (done by just setup).

CI

  • Push to main: compiles all sheets, uploads artifacts, generates visual diffs
  • Tagged release: attaches PDFs to GitHub release

Packages