Study PDFs

How do I turn researched notes into a printable study sheet with formulas and index cards?

6 min readView as markdown9 chunks · 1.7k tokens in docspack

A study sheet is one markdown file: settings in YAML frontmatter, notes in the body, index cards as :::card blocks. @getnarro/study turns it into a PDF with the same input giving the same layout every time. It runs offline; nothing is fetched at render time. Raw HTML in the body is dropped.

Quick start

No Narro deck is involved; the commands are narro study.

npx @getnarro/cli study init notes
npx @getnarro/cli study check notes/algebra.md
npx @getnarro/cli study notes/algebra.md

study init [dir] copies a sample and refuses to overwrite an existing one. study check <file> validates without a browser: errors are printed as file › path: message and exit 1, warnings are printed and exit 0. study <file> writes the PDF next to the input (--out picks another path, --html also writes the HTML). Printing needs Chromium, the same browser narro export --pdf uses.

Frontmatter

Only title is required. A key the schema does not list is an error, so a typo does not silently do nothing.

FieldTypeRequiredDescription
titlestringyes
subtitlestring—Line under the title
authorstring—Shown under the title
datestring—Shown under the title, printed as written
lang"de" | "en"—Document language, for hyphenation and labels. Default de.
paper"A4" | "Letter"—Paper size, for notes and cards. Default A4.
columnsinteger—Text columns of the whole sheet, 1 to 4. Default 1.
font"Inter" | "Source Serif 4" | "IBM Plex Sans"—Body font. Default Inter.
accentstring—Hex colour for headings and boxes. Default #2563eb.
cardsobject—Index card grid and duplex settings
cards.columnsinteger—Cards per row, 1 to 6. Default 2.
cards.rowsinteger—Rows per page, 1 to 10. Default 4.
cards.flip"long" | "short"—Duplex binding edge: long mirrors columns on the back, short mirrors rows. Default long.
cards.cutMarksboolean—Print cut marks outside the grid. Default true.
cards.numberedboolean—Number the cards. Default true.

Math

$…$ is inline math and $$…$$ on its own lines is display math, both rendered with KaTeX. A formula KaTeX cannot parse is an error that names the line.

The solutions of $ax^2 + bx + c = 0$ are

$$
x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$

Plots

A fenced block with the language plot draws function graphs as vector graphics in the PDF. There is no script and no extra dependency; the same text always gives the same picture. A plot works in running text, columns, boxes and cards, and is never split across a page.

```plot
y = x^2 | x²
y = sqrt(x) | Wurzel
y = sin(x)
x: -2pi..2pi
y: -2..4
width: 50%
```
  • y = <expression> | label is one curve per line, at least one. The label is optional; a legend appears when a curve has a label or there is more than one curve. Each curve has its own colour and dash pattern, so it stays readable in black and white.
  • x: a..b is the visible x range (default -5..5). y: a..b is the y range; without it, it is chosen from the curves.
  • width: full or width: 50% sets the width of the plot (default full).
  • # starts a comment.

Expressions use + - * / ^, parentheses, the variable x, the constants pi and e, and the functions sqrt abs sin cos tan exp ln log (log is base 10). The product sign may be left out: 2x, 3sin(x), 2(x+1), x(x-1). Unary minus binds looser than ^, so -x^2 is -(x^2). Where a curve is undefined or jumps out of the y range, as tan(x) does, the line is broken instead of joined.

A mistake (unknown key, bad range, bad expression) is an error that names the line in the markdown file; a plot is never silently left blank.

Boxes

A box is a fenced block named after its kind, with an optional title in brackets. The kinds are important, note, tip, warning and definition.

:::definition[Discriminant]
$D = b^2 - 4ac$ decides how many real solutions exist.
:::

Columns

columns: 2 in the frontmatter sets the whole sheet. For one part, wrap it in a columns block; an outer block needs more colons than the blocks inside it. :::column splits the part explicitly.

::::columns{n=2}
:::tip
Check the result by substituting it back.
:::
:::warning
Do not forget the second solution.
:::
::::

Cards

A card is a front, a line --- with a blank line above it (otherwise markdown reads a heading), and a back. The title in brackets is optional.

:::card[Formula]
What is the discriminant?

---

$D = b^2 - 4ac$
:::

Cards are collected from the whole body and printed after the notes, from page 1 on when the body has nothing else. The grid is cards.columns by cards.rows per page with a fixed cell size, so print at 100% scale. A partial last sheet keeps its empty cells so positions still line up. A card whose text would not fit its cell is a warning from study check, not an error; shorten it or use a larger cell.

Printing double-sided

Card pages come in pairs: a page of fronts, then a page of backs with the same cards mirrored, so each answer sits behind its question. Which mirror is right depends on how the printer turns the sheet, and a wrong choice puts every answer behind the wrong question.

  • cards.flip: long (the default): the sheet turns over its long edge, like a book. Printer dialogs call this “flip on long edge”. The backs reverse the columns of each row.
  • cards.flip: short: the sheet turns over its short edge, like a notepad. Printer dialogs call this “flip on short edge”. The backs reverse the rows.

Print a single test sheet, hold it to the light and check that a front and its back cover each other before printing a stack. Set the scale to 100% (“actual size”), never “fit to page”, or the cut marks no longer match the cell edges.

IntroductionWhat is Narro, and should I be writing markdown or React?
InstallationWhat do I install, and what does the project look like afterwards?
First deckWhat does a working React deck look like, end to end?
Markdown modeHow do I split a slide, style one word, or reveal a line — without leaving the markdown file?
Writing AI promptsWhat do I tell an AI so the deck it writes actually builds?
Rules for AI agentsWhat do I paste into my repo so an agent stops writing decks that build wrong?
React APIWhich component or hook do I import, and what does it take?
CLIWhich command do I run, and what are its flags?
Markdown APIHow do I read, edit, or validate a deck file from my own code instead of by hand?
Component referenceWhat props does this component take, and which package do I import it from?
Verifying a deckHow do I know my deck is actually correct?
AnimationHow do I reveal a list one line at a time, or move between slides with something other than a cut?
NavigationHow does the audience move through the deck, and how do I present it?
Canvas & positioningHow do I put something at an exact position instead of in the flow?
Images & mediaHow do I use an image as a background, tint it, or embed a video?
ArchitectureWhich package owns what, and why is the seam where it is?
Zooming canvasHow do I zoom and pan across one big canvas instead of cutting between slides?
Transform modeHow do I zoom and pan across one big canvas instead of cutting between slides?
Import & exportHow do I get this deck out as PPTX, PDF, or one file I can email?
VideoHow do I turn a story into a video, and keep it right when the words, the product or the source changes?
Recording a web appHow do I put a demo of my product in a deck or on a landing page without shipping a video of it?
Embedding a replayHow do I embed a recorded demo of my app in my React app, my Astro site, or any other page?
TerminalHow do I put a terminal demo in a deck, a README or a video, and find out when the tool it demonstrates stops saying what the demo says?
AI integrationHow do I wire an AI assistant up to Narro so it can write and build decks?
ThemingHow do I change the colours, fonts, and overall look of a deck?
Deck templatesHow do I define one house style with named layouts my slides can reference, like a PowerPoint master?
TroubleshootingSomething is wrong with my deck. What is it, and how do I fix it?
LimitationsWhat can't Narro do, and what do I do instead?
PDF documentsHow do I send a polished offer or invoice from a markdown file?
Explore your app as an agentHow does a coding agent check its own web UI change like a user would?
Study PDFsHow do I turn researched notes into a printable study sheet with formulas and index cards?