LaTeX and Pandoc
By Jason Galea · Part of the How to create a PDF benchmark
Takeaway: LaTeX is still the benchmark for academic typography and maths, and the LaTeX Tagging Project is making real progress on PDF/UA-2, but the toolchain is huge, slow, and awkward for data-driven app templates.
| Sample PDF | Size | Pages | Tagged | PDF/UA-1 | PDF/A-2a | Zürich / 東京 / 🚀 | Fig alt | Table tags |
|---|---|---|---|---|---|---|---|---|
| pandoc-latex | 46 KB | 2 | no | fail (10r / 91c) | fail (8r / 142c) | ✓ ✓ ✗ | ✗ | ✗ |
| pandoc-latex-tagged | 77 KB | 2 | yes | fail (3r / 5c) | fail (1r / 3c) | ✓ ✓ ✗ | ✓ | ✗ |
Checked with veraPDF 1.28.2 (r = failed rules, c = failed checks). Click any sample name to download the PDF, or test your own output in /validate (free, no sign-in) and inspect structure trees in /tags.
LaTeX has been typesetting books, academic papers and maths-heavy documents for decades. Most developers who use it today sit Pandoc or Quarto in front of it so they can write in Markdown and let LuaLaTeX or XeLaTeX handle the PDF output.
Important caveat before reading the table
Our automated test harness ran on TeX Live 2023 (LuaTeX 1.17.0, LaTeX2e 2023-11-01, Pandoc 3.1.3). That is old for the LaTeX Tagging Project, which has moved quickly over the last two years.
The LaTeX team's 2025 TUGboat report and documentation show that current TeX Live can emit PDF/UA-2 directly via \DocumentMetadata{tagging=on, pdfstandard=ua-2} on LuaLaTeX, though many third-party packages and publisher journal classes are still catching up. Treat the numbers in our table as a floor from Ubuntu's distro TeX Live 2023; we plan to re-run this sample on a current TeX Live release.
What we measured (TeX Live 2023 + Pandoc 3.1.3)
We ran the shared Quarterly Field Report (reference.md) through Pandoc + LuaLaTeX in two modes:
pandoc-latex.pdf(46 KB, 2 pages): plain Pandoc to LuaLaTeX. Untagged, failing PDF/UA-1 on 10 rules (91 checks) and PDF/A-2a on 8 rules (142 checks).pandoc-latex-tagged.pdf(77 KB, 2 pages): exported to.tex, prepended\DocumentMetadata{pdfstandard=A-2a, testphase=phase-III}, and compiled twice withlualatex.
The tagged run built real structure for headings (H1/H2/H3), lists (L/LI/Lbl/LBody), the Figure with /Alt, and the Link, and came very close on PDF/A-2a (1 rule / 3 checks: CID font descriptor metadata 6.2.11.4.2-2). However, on TeX Live 2023:
- The 36-row table was not tagged (
0 TR / 0 TD). - PDF/UA-1 failed on 3 rules (5 checks): the same CID font descriptor issue (
7.21.4.2-2), missingViewerPreferences, and no PDF/UA identifier. - Accents and CJK worked, colour emoji did not.
Zürich,São Pauloand東京survived text extraction, while🚀dropped out. - Default table sizing was rough. Pandoc's default
longtabletemplate rendered the table tiny and centred on the page until customised.
Pandoc and Quarto
Pandoc is still the Swiss Army knife for converting Markdown, reStructuredText or DOCX into PDF, and Quarto adds nice publishing features for technical and scientific reports. One useful recent shift: Quarto also supports Typst as a PDF backend now (Quarto PDF accessibility post), which avoids the multi-gigabyte TeX install when you don't specifically need LaTeX packages.
Pros and cons
Pros
- Unmatched typographic quality, bibliographies, cross-references and complex mathematical notation.
- Mature ecosystem of academic journal classes and Pandoc/Quarto Markdown workflows.
- Active LaTeX Tagging Project targeting modern PDF/UA-2 natively.
Cons
- Massive toolchain (easily several gigabytes for a full TeX Live container) and slow multi-pass builds measured in seconds.
- Tagging compatibility still breaks easily when you pull in older CTAN packages or custom macros.
- Painful for dynamic, data-driven business templates (escaping untrusted user strings in
.texis notorious for breaking builds or opening command-injection holes if--shell-escapeis anywhere nearby).
When LaTeX / Pandoc is the right call
- Academic papers, theses, books, or technical specifications where LaTeX maths, citations or a publisher's
.clsfile are non-negotiable. - Batch documentation builds in CI where container size and multi-second compile times don't matter.
If you want a similar local, deterministic document compiler without the TeX Live weight and package fragility, Typst is worth a serious look. If you are generating business documents from JSON or Markdown over HTTP, look at CSS paged media or makesPDF.