TeXSmith exam template.
Project description
TeXSmith Exam
texsmith-exam is an exam-focused template for TeXSmith.
It provides:
- An exam LaTeX template and renderer integration.
- Markdown helpers for question structures, multiple-choice answers, and fill-in blanks.
- Solution-aware rendering to generate both student and answer-key PDFs from the same source.
- Demo content and Makefiles to quickly produce sample exam/solution outputs.
The current template branding is oriented to HEIG-VD and can be adapted over time.
What it is
This repository contains:
- A TeXSmith template entry point:
exam. - A custom renderer registration for exam-specific behavior.
- Markdown extensions and rendering rules for:
- Heading-to-question/part/subpart mapping.
- Task-list-based multiple-choice blocks.
- Solution callouts (
!!! solution) with lines/grid/box options. - Fill-in-the-blank placeholders.
- Documentation source under
docs/. - Working demos under
demo/examanddemo/quiz.
Prerequisites
- Python
>=3.13 - uv installed
- A LaTeX environment available for TeXSmith PDF builds
Installation
From repository root:
uv sync --group dev --group docs
This installs runtime deps, dev/test tools, and docs tooling.
How to use
1. Prepare your exam markdown
Create one or more .md files using the exam syntax documented in:
docs/index.mddocs/syntax.md
Optional front matter can define title, author, language, and exam.* settings (see demo/exam/config.yml for a complete example).
2. Render with the installed template entry point
If the package is installed in your environment, use:
uv run texsmith render --template exam exam.md
Generate solution version from the same source:
uv run texsmith render --template exam -a solution=true exam.md
3. Render with the local template path (dev workflow)
From this repository, use the local template directly:
uv run texsmith -t src/texsmith_template_exam/exam exam.md --build
Solution mode:
uv run texsmith -t src/texsmith_template_exam/exam exam.md --build -a solution=true
4. Run the provided demos
Build exam + solution PDFs for the full demo:
make -C demo/exam
Outputs:
demo/exam/build/exam/exam.pdfdemo/exam/build/solution/solution.pdf
Build quiz demo:
make -C demo/quiz
Clean demo build artifacts:
make -C demo/exam clean
make -C demo/quiz clean
Build and use documentation
Serve docs locally (live reload)
uv run mkdocs serve
Then open http://127.0.0.1:8000.
Build static docs
uv run mkdocs build
Generated site output is in site/.
Development checks
Run tests:
uv run pytest
Run lint/format checks:
uv run ruff check .
uv run ruff format .
Repository layout
src/texsmith_template_exam/: package sourcesrc/texsmith_template_exam/exam/: template assets and manifestdocs/: MkDocs documentationdemo/: runnable examplestests/: automated tests
Extension points
- Renderer handlers:
src/texsmith_template_exam/exam_renderer.pydelegates to domain modules insrc/texsmith_template_exam/exam/. - Markdown extensions:
src/texsmith_template_exam/markdown.pyexportsexam_markdown_extensions(). - Template filters:
src/texsmith_template_exam/exam/__init__.pyregistersmarkdown_to_latex,exam_date,exam_version. - Compatibility layer for texsmith internals:
src/texsmith_template_exam/exam/texsmith_compat.py.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file texsmith_exam-0.2.0.tar.gz.
File metadata
- Download URL: texsmith_exam-0.2.0.tar.gz
- Upload date:
- Size: 119.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7a5ef50ce8b52e84e105804faa9df4b09507856947831fe83a7446871918501
|
|
| MD5 |
f666e3be77683e7ca80aafdf4ed44d2f
|
|
| BLAKE2b-256 |
ed15125a81d05399dd10b20c48b1b91435c42da67502d7ca55c2b32870003e5b
|
Provenance
The following attestation bundles were made for texsmith_exam-0.2.0.tar.gz:
Publisher:
release.yml on yves-chevallier/texsmith-exam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
texsmith_exam-0.2.0.tar.gz -
Subject digest:
f7a5ef50ce8b52e84e105804faa9df4b09507856947831fe83a7446871918501 - Sigstore transparency entry: 996310651
- Sigstore integration time:
-
Permalink:
yves-chevallier/texsmith-exam@928f7d0eb2e42a66f708a4d3bf53e4c61439ee97 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yves-chevallier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@928f7d0eb2e42a66f708a4d3bf53e4c61439ee97 -
Trigger Event:
push
-
Statement type:
File details
Details for the file texsmith_exam-0.2.0-py3-none-any.whl.
File metadata
- Download URL: texsmith_exam-0.2.0-py3-none-any.whl
- Upload date:
- Size: 41.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c5761b6e3f7188fc52fe516215bec804fedb19fe4596d3ce5af3fb19ff998d8
|
|
| MD5 |
073467c2115ba07e38f3232b9fce1d30
|
|
| BLAKE2b-256 |
63bc6771df9aae2ff93516e4da227ccd2f82bf09c1c80a3697d43c6873300744
|
Provenance
The following attestation bundles were made for texsmith_exam-0.2.0-py3-none-any.whl:
Publisher:
release.yml on yves-chevallier/texsmith-exam
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
texsmith_exam-0.2.0-py3-none-any.whl -
Subject digest:
7c5761b6e3f7188fc52fe516215bec804fedb19fe4596d3ce5af3fb19ff998d8 - Sigstore transparency entry: 996310654
- Sigstore integration time:
-
Permalink:
yves-chevallier/texsmith-exam@928f7d0eb2e42a66f708a4d3bf53e4c61439ee97 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/yves-chevallier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@928f7d0eb2e42a66f708a4d3bf53e4c61439ee97 -
Trigger Event:
push
-
Statement type: