here you goThings I’ve made, read and saved — shared here.

Archive

9,585 entries: 49 from X, 8,921 from Pinboard, saved 1998 to 2026.

Browse by tag, site, author, folder or language

Tags

Sites

Authors

Folders

Languages

8 entries#pandoc ×

2022

2021

2020

Pandoc

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

Guides on using Pandoc to write books

Editors

Customising pandoc

These are some of the examples of users customising pandoc to output LaTeX, HTML to their taste and requirements.

My own attempts are here:

Templates

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:

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

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

Sites built using Pandoc

Book publishing

  • [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

^b5a0d2

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}}

notes#markdown#pandoc

2018

2014

2010