Make a PDF
Renders Markdown → styled HTML (pandoc) → PDF (headless Chrome). Produces society-branded A4 output with a title page, table of contents, and per-section page breaks. No internet, no LaTeX required.
The two-step pipeline
Run from the society root (Scoiety Folders/). Give your report YAML metadata at
the top so the title page renders:
---
title: "Report Title"
subtitle: "A subtitle in small-caps"
author: "For <Person Name>, President 2026/27"
date: "1 July 2026"
---
# First Heading
...
Step 1 — Markdown → standalone HTML (CSS embedded):
pandoc "MyReport.md" -o "MyReport.html" -s --toc --toc-depth=1 \
-c ".claude/skills/make-pdf/report.css" --embed-resources --standalone
Step 2 — HTML → PDF via headless Chrome:
CHROME="/c/Program Files/Google/Chrome/Application/chrome.exe" # or Edge (see below)
UDD="$TMPDIR/ea_chrome_pdf_$$"
"$CHROME" --headless=new --disable-gpu --no-first-run --no-pdf-header-footer \
--user-data-dir="$UDD" --virtual-time-budget=15000 \
--print-to-pdf="<project>/MyReport.pdf" \
"file:///<project>/MyReport.html"
rm -rf "$UDD"
Edge works identically — swap the executable:
/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe.
Gotchas (learned the hard way)
--print-to-pdfMUST be an absolute path. A relative path resolves against Chrome's own directory and fails with "Access is denied." Use the fullC:/Users/.../file.pdfform (forward slashes are fine on Windows).- The input is a
file://URL with spaces percent-encoded (%20). - Use a throwaway
--user-data-dirso it never collides with an open browser window (otherwise headless may attach to the running profile and skip printing). --no-pdf-header-footerremoves Chrome's default URL/date header/footer; page margins come from@pageinreport.css.--toc-depth=1lists only top-level sections; raise it for finer contents.
Verify
python -c "import re;d=open('MyReport.pdf','rb').read();print('pages~',len(re.findall(rb'/Type\s*/Page[^s]',d)),d[:8])"
Expect %PDF-1.4 and a sensible page count. Clean up the intermediate .html
afterwards; keep the .md (editable source) and .pdf (deliverable).
Styling
report.css carries the society palette (ink #14202B, brass #A6803C, ECT-blue
#11487E). Edit it to restyle every report at once. It targets pandoc's default
HTML structure: header#title-block-header, nav#TOC, and h1/h2/h3.