fix(base): default pandoc typst template font so PDF export works without -V mainfont
Lint workflows / actionlint (push) Successful in 21s
Lint workflows / actionlint (push) Successful in 21s
pandoc's bundled typst template defaults the document font to an empty tuple (font: ()), so a naked `pandoc --pdf-engine=typst` fails with "font fallback list must not be empty". Patch the template default to Libertinus Serif (typst's own bundled default) at build time so PDF export works out of the box. Document usage in README and note the fix in CHANGELOG (Unreleased). Base-affecting.
This commit is contained in:
@@ -292,6 +292,26 @@ Assuming the compose file publishes `127.0.0.1:8765:8765` (see method B):
|
||||
> LaTeX-exact output you can install `texlive-xetex` on demand as a heavier
|
||||
> fallback. HTML export, KaTeX, Mermaid, and all REPL features work regardless.
|
||||
|
||||
### Generating a PDF with pandoc + typst
|
||||
|
||||
The base ships `pandoc` (front-end) and `typst` (PDF engine), so Markdown → PDF
|
||||
works out of the box:
|
||||
|
||||
```bash
|
||||
pandoc doc.md --pdf-engine=typst -o doc.pdf
|
||||
```
|
||||
|
||||
The base patches pandoc's bundled typst template so it defaults to the
|
||||
**Libertinus Serif** font. Without that patch a naked `--pdf-engine=typst`
|
||||
fails with `error: font fallback list must not be empty`, because the upstream
|
||||
template leaves the font unset. To pick a different face, pass one of the fonts
|
||||
typst can see (`typst fonts` lists them — DejaVu Serif/Sans/Mono, Libertinus
|
||||
Serif, New Computer Modern):
|
||||
|
||||
```bash
|
||||
pandoc doc.md --pdf-engine=typst -V mainfont="New Computer Modern" -o doc.pdf
|
||||
```
|
||||
|
||||
### Graphviz diagrams in Studio: `dot-watch`
|
||||
|
||||
pi-studio renders **Mermaid** natively but has **no Graphviz/DOT renderer**.
|
||||
|
||||
Reference in New Issue
Block a user