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.
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)
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
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