File size: 4,602 Bytes
16b79eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Classroom templates

Teaching material: lecture notes, worksheets, exams and 16:9 lecture slides. Friendly sans-serif
look with teal headings and coloured boxes for definitions, examples and notes.

## Templates
- **Lecture notes** (`notes`): course notes and handouts. Parameters: `title` (default
  `"Title"`), `course` (`none`), `lecturer` (`none`), `date` (today, e.g. "5 March 2026"). Prints
  the title with course · lecturer · date. Justified text, headings numbered `1.1`.
- **Worksheet** (`worksheet`): exercises for students. Parameters: `title` (`"Title"`), `course`
  (`none`). Prints the title and blank "Name:" and "Date:" lines. Headings are not numbered.
- **Exam** (`exam`): tests with points. Parameters: `title` (`"Title"`), `course` (`none`),
  `duration` (`none`, shown as "Time: ..."), `date` (today). Prints a centred title and a box with
  Name, Time and "Points: ___ / total". The total is the sum of all `question(points: ...)` values.
- **Lecture slides** (`slides`): 16:9 slides. Parameters: `title` (`"Title"`), `course`
  (`none`), `lecturer` (`none`), `date` (today). The first slide is a title slide made from these
  parameters. Footer: course and slide number.

## Writing a page
The template already sets: A4 page and margins (or 16:9 for slides), font and size, teal headings
with spacing, a header with course and title and a centred page number (notes, worksheet, exam).

Notes: use `=` for main sections, `==` and `===` below them; numbering is automatic.

Worksheet and exam: write each task with `question`; use `=` headings only to group parts
("Part A"). Add `answer-lines` where students write.

Slides:
- Each `= Heading` starts a new slide; the heading is the slide title (teal, orange underline).
- `== Heading` is a smaller subheading inside the current slide.
- Content after a `=` heading belongs to that slide until the next `=`. Text that does not fit
  flows onto an extra page without a title, so keep slides short.
- Do not create a title slide; it is generated from the parameters.

```typ
= What is a derivative?
#definition(title: "Derivative")[The rate of change of $f$ at $x$.]

= Rules
== Power rule
$ d/(d x) x^n = n x^(n-1) $
```

Plain markup works well: paragraphs, `-` lists, `+` numbered lists, `*bold*`, `_italic_`, `$...$`
maths, `#table(...)`, `#figure(..., caption: [...])`, `#image(...)`.

## Helpers

`definition(title: none, body)`: teal box labelled "Definition" (or "Definition: title").
```typ
#definition(title: "Prime number")[A natural number greater than 1 with no divisors other than 1 and itself.]
```

`example(title: none, body)`: blue box labelled "Example".
```typ
#example(title: "Small primes")[2, 3, 5, 7 and 11 are prime; 9 is not.]
```

`remark(title: none, body)`: orange box labelled "Note", for tips, warnings and side remarks.
```typ
#remark[1 is not a prime number.]
```

`question(points: none, body)`: a numbered question (1., 2., ... counted automatically). With
`points`, shows "(n points)" on the right and adds n to the exam total. Use for worksheets and
exams.
```typ
#question(points: 2)[Is 51 a prime number? Explain.]
#answer-lines(3)

#question[List all primes below 20.]
```

`answer-lines(count)`: `count` ruled lines for handwritten answers.
```typ
#answer-lines(4)
```

`callout(colour, label, title, body)`: the generic box behind the three above (all positional).
Use it only for a box kind that has no helper, with a template colour; pass `none` for no title.
```typ
#callout(teal, "Theorem", "Euclid")[There are infinitely many primes.]
```

`today`: today's date as text.

Colours, only when something must be coloured: `teal` (headings, definitions), `blue` (examples),
`orange` (notes, slide accents), `ink` (body text), `quiet` (grey secondary text). `sans` is the
font list.

## Do not
- Do not add `#set page`, `#set text`, `#set par` or font changes; the template sets them.
- Do not use your own colours (`rgb(...)`, `red`, ...); use the constants above only when
  something must be coloured.
- Do not build your own boxes with `block`, `rect` or `box`; use `definition`, `example`,
  `remark` (or `callout` for other kinds).
- Do not remove or edit the template header between `// znote:template` and `// znote:end`.
- Do not write the title, course, lecturer, date, name/date lines or the points box; the template
  prints them.
- Do not number questions or headings by hand, and do not write the total points; `question`
  counts and sums them.
- Do not draw answer lines with `#line`; use `answer-lines`.
- In slides do not use `#pagebreak()` to start slides; use `=`.