solman
Solutions manual writing utility. Though this utility is written in Python, the user is not expected to write any python as part of writing solutions. Rather, the solutions are written individually as markdown files (.md) in a meaningful directory structure. This package aims to convert those separate solutions into a variety of outputs, including a single LaTeX file as well as Pelican-compatible blog posts / web pages.
Solution Groups
A SolutionGroup represents a related collection of problem solutions. The problem solutions must be grouped into sections, by means of subdirectories. Each problem solution is a single ".md" file, but the SolutionGroup can be converted into a single LaTeX file. Exercise solution files begin with "ex-" prefix and problem solutions begin with "prob-" prefix (for instances when the distinction is useful).
Solution Group Structure
A SolutionGroup has a few important pieces:
- Sections a hierarchical level of grouping for problem solutions, often a chapter or section in the text from where the problems came.
- Solutions markdown files that may include latex. Each file represents the solution to a single problem, allowing for maximum versioning across problems.
- MetaData a YAML file at the top of the directory structure containing relevant metadata fields.
Specifically, the meta data file MUST contain the following fields:
- Author The author of the problems
- Book The source of the problems
- Category A categorical descriptor of the group (i.e. "Maths" or "Physics")
- Name A name for the group
- SolutionAuthor The author of the solutions
The meta data file may also contain the following OPTIONAL fields:
- ISBN The ISBN of the text from where the problems come
- ReferencesFile A BibTex file containing references, include the ".bib"
- SectionPrefix (default "Chapter") - the prefix for the section headings
- SolutionDate (default datetime.date.today) - The date of the solutions. Only set this value if the solutions are no longer likely to change.
- Subcategory A generic subcategorical label for the group, i.e. "Linear Algebra" or "Mechanics"
- Tags A comma-separated list of tags for the problems
Sample File Structure
The file structure below represents an example of a set of solutions called "demo", in which there are two sections (1 and 2), each of which have 1 exercise solution and 2 problem solutions. Notice how the problem solutions are prefixed with "prob-" and the exercise solutions are prefixed with "ex-". Also notice how the meta file is at the top of the directory. The bibtex file is optional.
demo
├── 1
│ ├── ex-1.md
│ ├── prob-1.md
│ └── prob-2.md
├── 2
│ ├── ex-1.md
│ ├── prob-1.md
│ └── prob-2.md
├── meta.yml
└── references.bib
Creating a SolutionGroup
Creating a SolutionGroup is simple. Once you have a directory structure that complies with above criteria, point the SolutionGroup.from_meta function at your meta file, and all solution files will be automatically discovered. Suppose that in the above example, the "demo" folder is in the home directory (or "~"). Then the below code would be sufficient to create the associated SolutionGroup:
>>> from solman import SolutionGroup
>>> s = SolutionGroup.from_meta("~/demo/meta.yaml")
>>> s.name
"SampleName"
Converting solutions to LaTeX
A SolutionGroup is capable of compiling all solutions into a single LaTeX file. Each solutions file (.md) is converted from Markdown to LaTex source using PanDoc [1]. The resulting LaTeX source snippets are combined using a Jinja template [2]. Finally, the result is converted to PDF using latexmk (to properly handle the building of document-references, i.e. table of contents or bibliography). The SolutionGroup class has a method for creating a Latex file:
>>> s.to_latex('~/sample.tex') # will output a combined LaTeX file
Converting solutions to PDF
Similar to converting solutions to LaTeX, converting solutions to pdf (via prior conversion to LaTeX) is as simple as calling the "to_pdf" method of the SolutionGroup.
>>> s.to_pdf('~/sample.pdf') # will output a combined PDF file
References
Metadata
Release files for solman 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| solman-0.0.2.tar.gz | 10.2 kB | Without provenance | Details for solman-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| solman-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for solman-0.0.2-py3-none-any.whl |
Total release size: 23.3 kB
Release files / solman-0.0.2.tar.gz
| Download URL | solman-0.0.2.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e505415bf484a0e7d116e1c4168bf6b67966a1afc792c197f3bdeb3d43e0d12
|
|
BLAKE2b-256 checksum How to use checksums |
71b5bd2bfbbda5d8aa7020a9589b3268309759eec929ccff53223a527937bdda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / solman-0.0.2-py3-none-any.whl
| Download URL | solman-0.0.2-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ccbfde1a6271b1a4583095bf76c87032d724fde1791d172e25f83fdc8cdb595a
|
|
BLAKE2b-256 checksum How to use checksums |
ee7693964ef2748fbf1dd55dce40a045f8e25add988de11e2edab487927e87ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for solman 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.