TeXSmith Exam Template¶
This project provides an exam template for TeXSmith. It includes an exam-centric LaTeX renderer with callouts and a structure tailored for assessments.
The template is currently tailored for HEIG-VD. The long-term goal is to offer a more generic version with configurable branding (logos, color palettes, and similar options).
Installation¶
The template needs TeXSmith >=0.9,<1.0: the exam constructs are an IR pass and
two emitters, declared by the template manifest.
Add the template as a dependency and install the required dependency groups:
uv sync --group dev --group docs
Quick start¶
Use the exam template with TeXSmith:
texsmith render --template exam exam.md
Enable solution mode when rendering to build the answer key:
texsmith render --template exam -a solution=true exam.md
Backends¶
The same sources render to LaTeX (the default) or to Typst:
texsmith --template exam config.yml *.md --build
texsmith --format typst --template exam config.yml *.md --build
Both backends read the exam constructs through the same IR pass and print the same exam: the cover page with its grade table and rules box, the questions and their parts, the multiple choices, the blanks and the space reserved for an answer, in exam mode and in solution mode alike. Two things are the LaTeX backend's only:
- a part's body is indented under its label — Typst refuses a page break inside
a container, and a
---or anewpage=trueinside a question is one; - a
latexraw block (```latex) is dropped by the Typst writer, as atypstraw block is dropped by the LaTeX one. A page break written that way is a---on both.
Title page¶
By default the template generates a dedicated cover page with the duration,
grade table, and rules. To render a minimal inline title instead, set
exam.titlepage to minimal in the front matter:
exam:
titlepage: minimal