layouts/pdf.typ is the Typst-side layout used by PDF and SVG notebook outputs.
themes/my-theme/
layouts/
pdf.typBefore Typst runs, Calepin renders this file with MiniJinja, the same engine used for HTML layouts (see Templating), so the output is still valid Typst source. The file uses a .typ extension because it renders to Typst, even though it is a MiniJinja template.
Inside the layout, place notebook content with doc.body:
#set page(
paper: "us-letter",
margin: (x: 1in, y: 0.85in),
numbering: "1",
)
#set text(font: "Libertinus Serif", size: 10.5pt)
{{ doc.body }}Useful layouts/pdf.typ values:
theme: local theme directory nametarget:pageddoc.path:.typinput path relative to workspacedoc.dir: input directory relative to workspacedoc.stem: input filename without.typdoc.title: document title, or an empty stringdoc.body: notebook body, injected as a#includedoc.meta: values from#metadata(...) <website-metadata>vars: merged document variables from[vars]incalepin.toml,calepin.setup(vars: ...), and CLI--set vars.<name>=...overrides
doc.body must be included explicitly if you want the notebook body in the rendered output.
theme = "typst" disables notebook-specific theming, and extends = "typst" creates a local theme with no inherited Calepin base. Use an empty layouts/pdf.typ for a minimal pass-through layout.