Pandoc Setup and Brand Pipeline Guide
Setup instructions for Pandoc with Solanasis brand templates for multi-format document generation from Markdown.
1. Overview
Pandoc is a universal document converter (GPL-licensed) that converts Markdown to PDF, DOCX, HTML, EPUB, and 50+ other formats. For Solanasis, Pandoc serves as the “Swiss army knife” bridge: Markdown source → branded PDF (via Typst engine) or branded DOCX (via reference document). This is the most versatile tool for multi-format output from a single Markdown source, making it ideal for deliverables that need to ship in multiple formats.
2. Installation (WSL2)
Install Pandoc
sudo apt install pandocVerify installation
pandoc --versionPDF output engine options
- Typst (recommended): Ensure Typst is installed per the Typst setup guide (typst-setup-and-brand-template-guide). Fastest compilation, best quality-to-complexity ratio.
- LaTeX (not recommended):
sudo apt install texlive-xetex(4GB+ install). Only needed for academic documents or if Typst is unavailable.
3. PDF via Typst Engine
Basic command
pandoc input.md -o output.pdf --pdf-engine=typstWith custom Solanasis template
pandoc input.md -o output.pdf --pdf-engine=typst --template=solanasis-pandoc.typAbout Pandoc-Typst templates
The Pandoc Typst template is different from a standalone Typst template. It wraps Pandoc’s variable system, allowing YAML frontmatter in Markdown to feed into the template. Key variables: $title$, $author$, $date$, $body$.
Solanasis Pandoc-Typst template
Save the following as solanasis-pandoc.typ (recommended location: solanasis-scripts/templates/pandoc/solanasis-pandoc.typ):
#let navy = rgb("#020532")
#let copper = rgb("#C47A3D")
#let parchment = rgb("#FEF9F1")
#let charcoal = rgb("#111827")
#set page(paper: "us-letter", margin: (top: 1.2in, bottom: 1in, left: 1in, right: 1in))
#set text(font: "Montserrat", size: 11pt, fill: charcoal)
#show heading.where(level: 1): set text(font: "Playfair Display", fill: navy, size: 24pt)
#show heading.where(level: 2): set text(font: "Montserrat", weight: "bold", fill: copper, size: 16pt)
// Title block
#align(center)[
#text(font: "Playfair Display", size: 28pt, fill: navy)[$title$]
#v(8pt)
#text(size: 12pt, fill: copper)[$author$ | $date$]
]
#v(24pt)
#line(length: 100%, stroke: 0.5pt + copper)
#v(12pt)
$body$Usage with YAML frontmatter
Write Markdown with YAML frontmatter that feeds into the template variables:
---
title: "Security Assessment Report"
author: "Dmitri Zasage, CEO — Solanasis LLC"
date: "April 2026"
---Then compile:
pandoc report.md -o report.pdf --pdf-engine=typst --template=solanasis-pandoc.typBrand color reference
| Name | Hex | Usage in template |
|---|---|---|
| Navy | #020532 | H1 headings, title text |
| Copper | #C47A3D | H2 headings, author/date line, horizontal rule |
| Parchment | #FEF9F1 | Available for page background (add fill: parchment to #set page) |
| Charcoal | #111827 | Body text |
4. DOCX via Reference Document
Concept
Pandoc uses a .docx reference document for styling. You create a branded reference doc once; all future DOCX output inherits its styles (headings, fonts, colors, headers, footers).
Create the reference document
pandoc -o solanasis-reference.docx --print-default-data-file reference.docxThen open solanasis-reference.docx in Word or LibreOffice and set these styles:
| Style | Font | Size | Color |
|---|---|---|---|
| Heading 1 | Playfair Display | 24pt | Navy #020532 |
| Heading 2 | Montserrat Bold | 16pt | Copper C47A3D |
| Body Text | Montserrat | 11pt | Charcoal #111827 |
| First Paragraph | Montserrat | 11pt | Charcoal #111827 |
Additional styling:
- Page background: Parchment FEF9F1 (optional — may not render in all viewers)
- Header: Solanasis logo + “Solanasis LLC”
- Footer: “solanasis.com | Page X”
Usage
pandoc input.md -o output.docx --reference-doc=solanasis-reference.docxStorage location
Store the reference doc at: solanasis-scripts/templates/pandoc/solanasis-reference.docx
5. Multi-Format Pipeline
The core value of Pandoc: one Markdown source, many output formats.
# From a single Markdown source:
pandoc proposal.md -o proposal.pdf --pdf-engine=typst --template=solanasis-pandoc.typ
pandoc proposal.md -o proposal.docx --reference-doc=solanasis-reference.docx
pandoc proposal.md -o proposal.html --standalone --css=solanasis.cssAll three commands use the same proposal.md source. Content is written once; formatting is handled by templates/reference docs.
Typical workflow
- Claude generates Markdown with YAML frontmatter
- Run Pandoc with the appropriate template for each requested format
- Deliver PDF to client, keep DOCX for client editing, host HTML internally
Format selection guide
| Format | Command flag | Template/Reference | Best for |
|---|---|---|---|
--pdf-engine=typst --template=solanasis-pandoc.typ | Typst template | Final deliverables, printing | |
| DOCX | --reference-doc=solanasis-reference.docx | Reference DOCX | Client-editable documents |
| HTML | --standalone --css=solanasis.css | CSS stylesheet | Web hosting, email embedding |
6. Integration with solanasis-scripts
- Pandoc templates should live in
solanasis-scripts/templates/pandoc/ - The reference DOCX and Typst template are the two key assets to maintain
- Future
generate-doc.pyenhancement could add--engine pandocflag for multi-format output - Pandoc pairs naturally with AI-generated Markdown: Claude writes content with YAML frontmatter, Pandoc renders to any format
Directory structure
solanasis-scripts/
templates/
pandoc/
solanasis-pandoc.typ # Typst template for PDF output
solanasis-reference.docx # Reference doc for DOCX styling
solanasis.css # CSS for HTML output (optional)
7. Troubleshooting
- “Typst not found as PDF engine”: Ensure
typstis in PATH; runwhich typst. If missing, install per typst-setup-and-brand-template-guide. - “Reference doc styles not applying”: Style names must match Pandoc’s expected names (Heading 1, Heading 2, Body Text, First Paragraph). See the Pandoc docs on reference docs.
- “Special characters breaking LaTeX output”: Use Typst engine instead (
--pdf-engine=typst) — Typst handles special characters cleanly without escaping. - “pandoc: command not found”: Run
sudo apt install pandocto install. Verify withpandoc --version. - Font not rendering in PDF: Ensure fonts (Playfair Display, Montserrat) are installed system-wide:
sudo apt install fonts-google-montserrator download from Google Fonts and install to~/.local/share/fonts/.
8. References
- Pandoc User’s Guide: https://pandoc.org/MANUAL.html
- Pandoc + Typst blog post: https://neilzone.co.uk/2025/01/using-pandoc-and-typst-to-convert-markdown-into-custom-formatted-pdfs-with-a-sample-template/
- Brand constants: gws-template-design-spec
- Typst setup: typst-setup-and-brand-template-guide
- Related: ai-native-document-generation-playbook
Last updated: 2026-04-12