A collection of math exercises I felt like writing.
| .github/workflows | ||
| exercises/complex-numbers | ||
| hooks | ||
| scripts | ||
| templates | ||
| .gitattributes | ||
| .gitignore | ||
| justfile | ||
| README.md | ||
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
- grape-suite - exercise formatting
- diverential - derivative notation