Pandoc template for generating PDFs via XeLaTeX. Produces a document with a title page, table of contents, Roboto font, A4 format, 2.5 cm margins, and page numbering.
---
## Requirements
- [Pandoc](https://pandoc.org)
- A TeX Live installation with XeLaTeX
- Homebrew (for installing fontconfig)
- Roboto and Roboto Mono fonts
---
## macOS Installation
### 1. Install Homebrew (if not already installed)
You should see several lines listing the Roboto and Roboto Mono font files. If nothing appears, double-check that the `.ttf` files are present in `~/Library/Fonts/`.
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.:
Pandoc's `article` class maps `#` → `\section`, `##` → `\subsection`, and so on. If your Markdown has a single `# Document Title` at the top followed by `## 1. Introduction`, `## 2. …`, etc., the title ends up as "Section 1" in the TOC and all real sections become subsections 1.1, 1.2, …
Passing `--shift-heading-level-by=-1` shifts every heading up one level before rendering:
| Markdown | Without flag | With flag |
|----------|-------------|-----------|
| `#` | `\section` (appears in TOC) | promotes to document title — invisible in body |
| `##` | `\subsection` | `\section` |
| `###` | `\subsubsection` | `\subsection` |
The `#` heading is absorbed as the top-level title and removed from the body, so your real sections (`##`) become proper `\section` entries.
### Section numbering
By default the template **suppresses LaTeX auto-numbering** (`secnumdepth = 0`), because headings written as `## 1. Introduction` already carry their own numbers. Letting LaTeX add its own would produce double-numbering like `1 1. Introduction`.
If you prefer LaTeX to number sections automatically (and write headings without embedded numbers, e.g. `## Introduction`), pass `--number-sections`:
XeLaTeX is not installed or not on your PATH. Install MacTeX or BasicTeX and open a new terminal session.
**`The font "Roboto" cannot be found`**
The font is not installed. Follow step 6 above.
**`File 'titlesec.sty' not found`**
A required LaTeX package is missing. Run the `tlmgr install` command in step 4.
**`No counter 'none' defined`**
A known pandoc + longtable bug. The template includes a fix for this — make sure you are using the latest version of `template_first-skyfritt-example.tex`.
**`fc-list: command not found`**
fontconfig is not installed. Run `brew install fontconfig`.