Skip to main content

TeXSmith exam template.

Project description

TeXSmith Exam

Python Build system Package manager Docs

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/exam and demo/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.md
  • docs/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.pdf
  • demo/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 source
  • src/texsmith_template_exam/exam/: template assets and manifest
  • docs/: MkDocs documentation
  • demo/: runnable examples
  • tests/: automated tests

Extension points

  • Renderer handlers: src/texsmith_template_exam/exam_renderer.py delegates to domain modules in src/texsmith_template_exam/exam/.
  • Markdown extensions: src/texsmith_template_exam/markdown.py exports exam_markdown_extensions().
  • Template filters: src/texsmith_template_exam/exam/__init__.py registers markdown_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

texsmith_exam-0.2.4.tar.gz (121.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

texsmith_exam-0.2.4-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file texsmith_exam-0.2.4.tar.gz.

File metadata

  • Download URL: texsmith_exam-0.2.4.tar.gz
  • Upload date:
  • Size: 121.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for texsmith_exam-0.2.4.tar.gz
Algorithm Hash digest
SHA256 4d7672f99ad952f0bafe32deed6036d44f7d81f3297c1a99a3d02b8d2447a939
MD5 efe4fbad91ff5f0c6797e49254cb7967
BLAKE2b-256 26e3f51d95a87f73c3855d81bf1c8180ec4bb4b73eb33ea7866a23f374768795

See more details on using hashes here.

Provenance

The following attestation bundles were made for texsmith_exam-0.2.4.tar.gz:

Publisher: release.yml on yves-chevallier/texsmith-exam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file texsmith_exam-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: texsmith_exam-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 42.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for texsmith_exam-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c11a7f4b93c41bb6ec6771fe7858e5f7d1e9eac48eca198727d11fc9850f6c91
MD5 066d576846b7e42c213cc08d0ffbe513
BLAKE2b-256 fba42d73fbc47aa5b21a807512254d496380b606ea24601ec5a18c4c1f9ad4e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for texsmith_exam-0.2.4-py3-none-any.whl:

Publisher: release.yml on yves-chevallier/texsmith-exam

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page