solrub
Build the student, solution and rubric PDFs of a LaTeX assignment.
One .tex source carries all three copies. \sol marks what only the
answer key shows and \rub what only the grading rubric shows; each copy is
a pdflatex run defining a different subset of them.
pip install solrub
Use
solrub quiz1a # quiz1a.pdf, quiz1a_sol.pdf, quiz1a_rub.pdf
solrub quiz1* # every version at once
solrub quiz1/ # every document in a folder
solrub --no-sol --no-rub blank
All three copies are the default; --no-sol and --no-rub opt out. Add
-p to sum the points (needs pip install "solrub[pts]").
Arguments are files, globs or directories, with the .tex suffix optional.
Globs are expanded by the tool rather than left to the shell, so quiz1*
works the same on Windows. Two filters keep a wide pattern honest: sibling
builds (quiz1a.pdf, quiz1a_sol.pdf) collapse onto the .tex they came
from, and a fragment with no \documentclass is skipped. A failed document
does not stop the rest of the batch; the failures are listed at the end.
In the document
Three macros divide the source. \answer and \rubric are hidden by
default and revealed by their build; \exam is the reverse, student-only
content such as the blank space left for the work, dropped from both keys.
\newcommand{\answer}[1]{}
\newcommand{\rubric}[1]{}
\newcommand{\exam}[1]{#1}
\ifdefined\sol
\renewcommand{\answer}[1]{#1}
\renewcommand{\exam}[1]{}
\fi
\ifdefined\rub
\renewcommand{\rubric}[1]{#1}
\renewcommand{\exam}[1]{}
\fi
Requires
pdflatex on the PATH, and Python 3.9 or newer.
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 solrub-0.1.0.tar.gz.
File metadata
- Download URL: solrub-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e7ddf877cf3ba8763e9140911ff7c3d0c53f24db5c98f15b52cdb094e27d67e
|
|
| MD5 |
d6a259db4cf709577142643b967562bb
|
|
| BLAKE2b-256 |
8614a6b41a1b4143aafcc021200a900db0b215e1cd24b9629709554ca78b77d2
|
File details
Details for the file solrub-0.1.0-py3-none-any.whl.
File metadata
- Download URL: solrub-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccbabc44cbe29a3dd64a2b30f975e00acadd6176a512e1adebecbb8b2b5465d3
|
|
| MD5 |
322867c3ef11acdf7b71056a448a811c
|
|
| BLAKE2b-256 |
e1d81fe0f70e600d9b7647d360a1f1ac65e063e0f964bb7ea79609e3ac523575
|