A Title That Says Exactly What the Note Covers
Open with a short paragraph that frames the whole note in plain language: what it covers, why it matters, and how the pieces connect. Name the key terms in bold on first use. Prefer warm, precise prose over bullet dumps.
In one line. A one- or two-sentence spine of the whole note, set off as a blockquote so a reader skimming gets the gist before diving in.
How a note is put together
Every note follows the same spine, which you can see above:
- a title (
# …) that names the content, not the week or lecture; - the numbering
<style>block (copy it verbatim into every note); - an intro paragraph and a > In one line. blockquote;
- a Contents list inside a
note-cardwith anchor links; then - the sections, separated by
---rules.
The body then works top-down: each section states its idea in prose, then shows the supporting equation, diagram, chart, or table as a captioned block. Aim for a reader who has never seen the topic: motivate before you formalise.
Headings, sections, and cross-references
Give every heading an explicit id so it can be linked and stays stable if you reword the title:
- Top-level section:
## Section title {#sec-slug}— auto-numbered1.,2., … - Subsection:
### Subsection {#sec-sub}— auto-numberedN.1,N.2, …
Then cross-reference by that number: "as shown in §3.1" or
"(§1)". Because the numbers are generated from the heading order,
they always match the Contents list — just keep your written §N.M references in
step if you reorder sections.
A note on subsections
This subsection exists only so you can see the automatic 2.1 numbering in action.
Use subsections when a section has two or more distinct moves; otherwise keep it flat.
Captioned blocks: equations, figures, tables
Anything worth pointing at — a display equation, a diagram, a table — goes in a
:::caption block. It gets a numbered, captioned frame (Equation 3.1,
Figure 4.1, …) and an anchor you can link to. The title="…" is the caption text;
write math in it as $…$ (see §5 for the rule).
Equations
Frame a display equation like this — a short, self-contained statement of one fact:
Refer back to it as (eq. eq-pythagoras). Use \underbrace{…}_{…}
to annotate parts of an equation inline, and prove non-obvious steps in full rather
than asserting them.
Tables
For tables, use type="table" raw="1" and hand-write the HTML inside a
table-compact wrapper (this gives you full control over headers and alignment):
| quantity | symbol | value |
|---|---|---|
| legs | $a,\ b$ | 3, 4 |
| hypotenuse | $c$ | 5 |
Diagrams with NeuralFlow
Use a neuralflow block for any flow, pipeline, architecture, or computation graph.
Nodes carry a [Title | detail] label (math via $…$); edges are A --> B : label.
Status colours are used consistently: inputs status=info, data status=off,
intermediates status=warn, output status=ok.
When you show a backward / gradient pass, mirror the forward diagram: flow the
other way, colour the edges red ({#dc2626}), label each edge with the local slope,
and put the accumulated quantity in each node.
Charts (math in KaTeX, words in SF Pro)
Plots are Chart.js blocks: a <div id="chart-…"> placeholder plus a
<script class="chartjs-config" data-target="…"> with the config as JSON.
Always set "katexLabels": true. The engine then renders the legend and axis
titles as HTML around the canvas, so you can follow the one rule that governs every
label and caption in these notes:
Math → KaTeX, words → SF Pro Display. Wrap every mathematical symbol in
$…$; leave plain words unwrapped. So a legend entry readsmove $x$ (slope 1), and an axis title readsvalue $f, g$— the letters render as crisp KaTeX, the words in the page font.
One gotcha worth memorising, because the two contexts escape backslashes differently:
- Inside the chart JSON, LaTeX backslashes must be doubled:
"$\\sigma(x)$","$x^2$"(no backslash needed here),"$33 + 18\\delta$". - Inside a caption
title="…"(which is HTML, not JSON), use a single backslash:title="… $\sigma(x)$ …".
Callouts, intuition, and proofs
Two devices carry the "why," so the main line of prose stays clean:
A blockquote holds an aside — an intuition, a derivation, or where a formula comes from:
Where it comes from. State the principle in one or two sentences, then the key step. Keep it to the insight; the full algebra can go in an equation block.
A note-card groups a small, self-contained aside (a definition, a checklist, a
worked micro-example) into a bordered card:
Definition — right triangle. A triangle with one $90^\circ$ angle. Its longest side, opposite the right angle, is the hypotenuse $c$; the other two are the legs $a$ and $b$. Everything in §3.1 follows from this.
When a result is not obvious, prove it — show the algebra with \underbrace
annotations rather than asserting the answer.
Code and pseudocode
Use a fenced python block for real code, and a text block for pseudocode. Align
trailing # comments so shapes and intent line up:
def hypotenuse(a, b):
return (a**2 + b**2) ** 0.5 # √(a² + b²) — the Pythagorean theorem
Repeat until converged {
step = compute_update() # one move
state = state - step # apply it
}
Voice and finishing
A few habits keep the notes consistent:
- Motivate, then formalise. Say what a thing is and why it matters before the symbols appear.
- Bold the key term on first use; keep paragraphs tight; prefer prose to bullets except for genuine lists.
- Every number is checked. Verify any figure in a table, chart, or worked example
before you commit it (a plain
python3one-liner is enough). - Point forward. End a section by naming what the next one builds toward.
- Verify the render. Screenshot new diagrams and charts — see the build/verify
loop and gotchas in
../Machine Learning Notes/CLAUDE.md.
Ready to write? Copy this file, rename it for your topic, keep the
<style>block and the front-matter shape, delete these example sections, and fill in your own. The rendered result and this source are your two references.