This commit is contained in:
jostein 2026-03-27 12:21:04 +01:00
parent e3e4f46cf1
commit 3b9daef024
4 changed files with 33 additions and 8 deletions

View file

@ -57,9 +57,16 @@ sudo tlmgr install \
xcolor \
fontspec \
geometry \
babel
babel \
pgf \
currfile \
filehook
```
- `pgf` — provides TikZ, used to draw the vertical colour bar on the title page
- `currfile` — resolves the template's directory at compile time, used to locate the logo file
- `filehook` — required by `currfile`
### 5. Install fontconfig
`fc-list` and `fc-cache` are needed for font verification and are not included on macOS by default:
@ -129,8 +136,19 @@ Then compile with:
```bash
pandoc input.md -o output.pdf \
--pdf-engine=xelatex \
--template=template_first-skyfritt-example.tex \
--shift-heading-level-by=-1
--template=./path/to/template_first-skyfritt-example.tex \
--shift-heading-level-by=-1 \
-V templatedir=./path/to/template_first-skyfritt-example.tex
```
### Why `-V templatedir=...`?
The template includes a logo image (`skyfritt-logo_borderless.pdf`) referenced by filename only. XeLaTeX resolves bare filenames relative to the working directory where pandoc is invoked — not the template's own directory. Passing `-V templatedir=` tells the template where to look for the logo, so it is found regardless of which directory you run pandoc from.
The value should be the directory containing the template and logo files, e.g.:
```bash
-V templatedir=./convertion_templates_pandoc/template_pdf-via-xelatex
```
### Why `--shift-heading-level-by=-1`?
@ -156,9 +174,10 @@ If you prefer LaTeX to number sections automatically (and write headings without
```bash
pandoc input.md -o output.pdf \
--pdf-engine=xelatex \
--template=template_first-skyfritt-example.tex \
--template=./path/to/template_first-skyfritt-example.tex \
--shift-heading-level-by=-1 \
--number-sections
--number-sections \
-V templatedir=./path/to/template_first-skyfritt-example.tex
```
You can also control the depth of numbering with the `secnumdepth` metadata variable: