diff --git a/convertion_templates_pandoc/lorem_ipsum_via_pdf-from-xelatex_first-skyfritt-example.pdf b/convertion_templates_pandoc/lorem_ipsum_via_pdf-from-xelatex_first-skyfritt-example.pdf new file mode 100644 index 0000000..4d80d6f Binary files /dev/null and b/convertion_templates_pandoc/lorem_ipsum_via_pdf-from-xelatex_first-skyfritt-example.pdf differ diff --git a/convertion_templates_pandoc/template_pdf-via-xelatex/skyfritt-logo_borderless.pdf b/convertion_templates_pandoc/template_pdf-via-xelatex/skyfritt-logo_borderless.pdf new file mode 100644 index 0000000..f401ffa Binary files /dev/null and b/convertion_templates_pandoc/template_pdf-via-xelatex/skyfritt-logo_borderless.pdf differ diff --git a/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.md b/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.md index 99199d3..eaf9cf4 100644 --- a/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.md +++ b/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.md @@ -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: diff --git a/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.tex b/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.tex index 6875836..4aaff75 100644 --- a/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.tex +++ b/convertion_templates_pandoc/template_pdf-via-xelatex/template_first-skyfritt-example.tex @@ -133,6 +133,9 @@ $endif$ %% ── Graphics & figures ──────────────────────────────────────────────────────── \usepackage{graphicx} +$if(templatedir)$ +\graphicspath{{$templatedir$/}} +$endif$ \usepackage{float} \makeatletter \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} @@ -185,15 +188,18 @@ $endif$ rectangle ++(1.27cm, -29.70cm); \end{tikzpicture} \raggedright - \vspace*{4cm} + \vspace*{0.3cm} - {\Huge\bfseries\color{accent} $title$ \par} + \includegraphics[width=5.5cm]{skyfritt-logo_borderless.pdf}\par + \vspace{1.3cm} + + {\fontsize{38}{32}\selectfont\color{accent}\MakeUppercase{$title$} \par} \vspace{0.5cm} {\color{vertbar}\rule{3.31cm}{0.2cm}} \vspace{1cm} $if(subtitle)$ - {\large\itshape $subtitle$ \par} + {\fontsize{15}{20}\selectfont $subtitle$ \par} \vspace{1cm} $endif$