Pandoc is a program that converts between various text markup formats.
Pandoc allows you to customise the output via extensive command line arguments and by templates.
My projects related to Pandoc
- Semantic CSS for Pandoc — an attempt at finding and using various semantic Cascading Style Sheets with Pandoc’d default HTML rendering.
- Pandoc + Missing.css — is instructions on how to use missing.css to style pandoc output. Summary: you will have to wrap the $body$ variable in
<main> </main>tag.
Writing Papers
- mpark/wg21: Framework for Writing C++ Committee Papers; you can see an example output here
Guides on using Pandoc to write books
- This guide on how to setup pandoc to write fiction by Eugene Kiss is a very good introduction to using Pandoc to produce print-ready material.
- words by Steve Klabnik.
Editors
- Build an Amazing Markdown Editor Using Visual Studio Code and Pandoc | thisDaveJ
- PanWriter Markdown editor for macOS, Windows and Linux.
Customising pandoc
These are some of the examples of users customising pandoc to output LaTeX, HTML to their taste and requirements.
- github.com/smile/pandoc-templates
- github.com/claes/pandoc-templates
- github.com/kjhealy/pandoc-templates
- pandoc academic publication
- IEEE Pandoc template by cscorley — is what i used for writing a IEEE style paper.
- Typesetting automation · A plain-text workflow for painless production of personal documents & offline correspondence—featuring Pandoc, LaTeX, and a simple makefile
- a makefile for pandoc
- msprev/panzer: pandoc + styles
- Heer de Beer.org—Pandocomatic ”… is a tool to re-use these common configurations by specifying a so-called pandocomatic template in a YAML configuration file.”
My own attempts are here:
Book templates
- https://github.com/btbytes/pandoc-ebook-template an updated fork of https://notabug.org/kmac/pandoc-ebook-template
- mre/pandoc-memoir Convert Markdown to beautiful PDF using pandoc, LaTeX, and chocolate donuts.
Filters
Pandoc filters can be written in Haskell which modify the document structure programmatically. These are some of the user written filters that are instructive:
- pandoc-emphasize-code — “A Pandoc filter for emphasizing code in fenced blocks.”
- bitbucket.org/mpastell/pandoc-filters
- pandoc-reference-filter — This pandoc filter implements an internal reference manager for pandoc, making it possible to reference images and sections that have attribute tags.
- Aditya Mahajan shows how to use gpp preprocessor to include source code files
- baig/pandoc-csv2table: A Pandoc filter that renders CSV as Pandoc Markdown Tables.
- Panflute: pandoc filters made simple — panflute 1.9.7 documentation
- CSV Tables in Markdown — Pandoc Filter for CSV Tables
- PP - A generic Preprocessor (with Pandoc in mind)
- ChartSS.css — to allow easy creation of simple charts for documentation, data storytelling / journalism, etc. It features plots of 1-D lists, and has a custom markdown filter that converts suitably formatted lists directly to charts. It has no dependencies (other than a modern browser), and is very small compared to javascript based charting tools. The html is based on
<ul>lists and will collapse back to readible lists in the absence of css support, making it accessible to all readers.
Exporters
Ox-pandoc is an exporter that translates Org-mode file to various other formats via Pandoc.
Markdown to InDesign; Pandoc now ships with a writer able to produce an ICML file from any Pandoc-supported input file format.13 ICML is the document format of Adobe InCopy; Dec 2015.
Books written using pandoc
- The little Redis book
- My own attempts at converting Chuck Moore’s Programming a Problem-oriented language into a “book” using pandoc and some elbow grease. The result is available on github - https://github.com/btbytes/pol
- littleosbook — “The little book about OS development”. Outputs HTML and PDF.
- Customizing pandoc to generate beautiful pdfs from markdown | learnbyexample
- beejjorgensen/bgipc: Beej’s Guide to Unix Interprocess Communication source; uses Beej’s Guide Build System for Pandoc.
See also
- Laika — Text Markup Transformer for sbt and Scala applications, transforming markdown and reStructuredText to HTML and PDF
- lise-henry/crowbook — converts books written in Markdown to HTML, LaTeX/PDF and EPUB.
Styling
- jez/pandoc-sidenote: Convert Pandoc Markdown-style footnotes into sidenotes
- panam stylesheet for pandoc
- cysouw/toc-css: Pandoc Lua Filter to add table of contents to the side
- Use GitHub - jez/pandoc-sidenote: Convert Pandoc Markdown-style footnotes into sidenotes along with GitHub - jez/tufte-pandoc-css: Starter files for using Pandoc Markdown with Tufte CSS to render markdown into Edward Tufte style documents, as seen here - Tufte Pandoc CSS and Tufte CSS
Sites built using Pandoc
- Openresty.org uses Pandoc, makefile and perl.
- website/make at master · kisslinux/website
Book publishing
- The Tools I Use To Write Books - Thorsten Ball * pp is a text preprocessing tool written in haskell (just like pandoc), the implements - macros, literate programming, diagrams - graphviz, plantuml, ditaa, blockdiag, figures - asymptote, R, scripts - bash, cmd, python, lua, R, and mustache templating. apparently to be replace by ypp and panda
- Writing a Book with Pandoc, Make, and Vim — Vladimir Keleshev
- Technical Writing with Pandoc and Panflute
- max-heller/mdbook-pandoc: A mdbook backend powered by Pandoc.
- [output.pandoc.profile.pdf] + output-file = “output.pdf” + to = “latex”
Using with weasyprint
From an HN thread:
It’s even possible to replace (Xe)LaTeX with weasy, a Python HTML-to-PDF converter. It supports two-colums via CSS, automatic CSS hypens, CSS page counters and embedding SVGs. I just needed an HTML header with CSS in the markdown file.
$ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0.5in -V margin-left:0.5in -V margin-right:0.5in -o output.html input.md
$ python3 -c "from weasyprint import HTML; HTML('output.html').write_pdf('output.pdf', presentational_hints=True)"
For LaTeX-style math equations I added mathjax-pandoc-filter as filter to the pandoc args:
--filter ~/node_modules/.bin/mathjax-pandoc-filter -Mmathjax.centerDisplayMath -Mmathjax.noInlineSVG
SVG2PDF
If you are trying to convert an HTML page to PDF using Pandoc, and the HTML page has svg drawings (e.g.: this excellent post - The Big LLM Architecture Comparison by Sebastian Raschka), pandoc might choke on it unless you have rsvg-convert installed (on macOS: brew install svg2pdf). As you can see from this commit that added passing svg through rsvg-convert command to covnert it into a png file.
also had to install the latex svg package.

even after this the PDF generation failed with:
pdflatex: major issue: User/administrator updates are out-of-sync. Error producing PDF.
! Package svg Error: File `1e7afdcc9b596b58d739c7d01b66c47cb52f6c23_svg-tex.pdf ' is missing.
See the svg package documentation for explanation.
Type H <return> for immediate help. ...
l.140 ...dcc9b596b58d739c7d01b66c47cb52f6c23.svg}}