157 lines
5.4 KiB
Markdown
157 lines
5.4 KiB
Markdown
# Clean Sheets
|
|
|
|
Clean, modern exercise sheets for university courses. The package provides two
|
|
page layouts, an exercise overview, statement boxes, syntax-highlighted code,
|
|
and small helpers for mathematical and German-language course material.
|
|
|
|
## Examples
|
|
|
|
### Base template
|
|
|
|
<a href="examples/base.pdf">
|
|
<img src="examples/base.png" width="250px" alt="A simple exercise sheet using the 'base-template' layout."/>
|
|
</a>
|
|
|
|
A simple exercise sheet using the `base-template` layout.
|
|
[View source code](examples/base.typ)
|
|
|
|
### Formal template
|
|
|
|
<a href="examples/formal.pdf">
|
|
<img src="examples/formal.png" width="250px" alt="A formal exercise sheet using the 'formal-template' layout."/>
|
|
</a>
|
|
|
|
A formal exercise sheet using the `formal-template` layout.
|
|
[View source code](examples/formal.typ)
|
|
|
|
|
|
## Quick start
|
|
|
|
Create a ready-to-edit project:
|
|
|
|
```sh
|
|
typst init @preview/clean-sheets:0.3.0
|
|
```
|
|
|
|
Or import the package in an existing document:
|
|
|
|
```typst
|
|
#import "@preview/clean-sheets:0.3.0": base-template, ex_box, qed
|
|
|
|
#show: body => base-template(
|
|
1,
|
|
[Linear Algebra I],
|
|
[Prof. Ada Example],
|
|
[Dr. Alan Assistant],
|
|
3,
|
|
([Jane Doe], [John Doe]),
|
|
[Taylor Tutor],
|
|
show-logo: false,
|
|
body,
|
|
)
|
|
|
|
= Exercise 1
|
|
|
|
#ex_box(heading: [Warm-up], points: [10 points])[
|
|
Prove that $1 + 1 = 2$.
|
|
]
|
|
|
|
The proof is immediate. #qed
|
|
```
|
|
|
|
## Templates
|
|
|
|
### `base-template`
|
|
|
|
The general exercise-sheet layout. Its required positional arguments are
|
|
`sheetnumber`, `course`, `prof`, `assistant`, `exercises`, `students`, `tutor`,
|
|
and `body`.
|
|
|
|
Optional arguments:
|
|
|
|
- `tutor-label`: custom label beside the tutor name (`none`)
|
|
- `sheet-label`: name displayed before the sheet number (`[Exercise Sheet]`)
|
|
- `logo`: logo content, usually `image("logo.png")` or similar (`none`)
|
|
- `track-heading-counter`: whether to track heading counters for custom box
|
|
components (see below) (`true`)
|
|
- `page-numbering`: custom page-numbering function
|
|
- `table-header-smallcaps`: use small capitals in table headers (`false`)
|
|
- `text-font` and `math-font`: font families with portable fallbacks
|
|
- `no-pagebreak`: whether to avoid page breaks between exercises (level 1
|
|
headings) (`true`)
|
|
- `show-credits`: display the package credit (`false`)
|
|
- `credits`: custom credit content
|
|
|
|
### `formal-template`
|
|
|
|
A denser layout with (German) submission and attestation dates, optional digit
|
|
grouping, and decimal-comma formatting. Required arguments are `sheetnumber`,
|
|
`course`, `students`, `semester`, `university`, `institute`, and `body`.
|
|
|
|
Optional arguments:
|
|
|
|
- `subtitle`: custom subtitle for this exercise sheet (`none`)
|
|
- `department`: custom department name (`none`)
|
|
- `submit-until`: a `datetime` object for the submission deadline (`none`)
|
|
- `attestations-from`: a `datetime` object for the beginning of the attestation
|
|
period (`none`)
|
|
- `attestations-until`: a `datetime` object for the end of the attestation
|
|
period (`none`)
|
|
- `info-text`: custom text to be displayed in the very beginning of the
|
|
document (`none`)
|
|
- `track-heading-counter`: whether to track heading counters for custom box
|
|
components (see below) (`false`)
|
|
- `page-numbering`: custom page-numbering function
|
|
- `group-digits`: whether to group digits in numbers, e.g. `1 000` instead of
|
|
`1000` (`true`)
|
|
- `decimal-comma`: whether to use a decimal comma instead of a decimal point
|
|
(`false`)
|
|
- `raw-syntaxes`: a list of syntax names to be rendered as raw code blocks
|
|
- `text-font` and `math-font`: font families with portable fallbacks
|
|
- `table-header-smallcaps`: whether to use small capitals in table headers
|
|
(`false`)
|
|
- `no-pagebreak`: whether to avoid page breaks between exercises (level 1
|
|
headings) (`false`)
|
|
|
|
## Components and helpers
|
|
|
|
- `exercise`: exercise box with optional `heading`, `points`, `color`,
|
|
`stroke-color`, `text-color`, and `radius`
|
|
- `definition`, `axiom`, `theorem`, `lemma`, `corollary`: numbered statement
|
|
boxes; each takes a body and the optional arguments `label`, `nobreak`, and
|
|
`lang`.
|
|
There are also the aliases `satz` and `korollar` for German-language documents.
|
|
- `Cal` and `Complement`: calligraphic and complement math helpers
|
|
- `chevrons`: wraps comma-separated math content in angle brackets
|
|
- `german-date-time`: formats a datetime in German
|
|
- `group-digits-text`: groups digits in a string
|
|
- `qed`: right-aligned square; `jb`: justified line break
|
|
- `smallcaps` and `upper`: tracked small-cap and uppercase helpers
|
|
|
|
See `examples/base.typ` and `examples/formal.typ` for complete source
|
|
examples.
|
|
|
|
## Fonts
|
|
|
|
The default font stack prefers Fira Sans, Fira Math, and Fira Code, with
|
|
fallbacks that are available in a standard Typst installation:
|
|
|
|
* body text: `Fira Sans`, falling back to `New Computer Modern`
|
|
* math: `Fira Math`, falling back to `New Computer Modern Math`
|
|
* code: `Fira Code`, falling back to `DejaVu Sans Mono`
|
|
|
|
The Fira fonts are available by default in the Typst web app. The local Typst
|
|
CLI, however, only bundles a small set of fonts, including New Computer Modern,
|
|
New Computer Modern Math, and DejaVu Sans Mono. When the Fira fonts are not
|
|
installed locally, Typst therefore uses the respective fallback fonts.
|
|
|
|
You can check which fonts are available to your local Typst installation with
|
|
`typst fonts`. If you prefer different fonts, pass `text-font` and `math-font`
|
|
to either template.
|
|
|
|
## License and credits
|
|
|
|
Clean Sheets is licensed under the MIT License. The bundled
|
|
`assets/OneHalfLight.tmTheme` is the MIT-licensed One Half Light theme by Son
|
|
Pham; see `LICENSE-OneHalfLight`.
|