Pandoc tips and tricks

Using citations in markdown source

Pandoc contains several filters to handle references between different file types, using CLS definitions doc.

Example YAML Header:

filters:
- pandoc-citeproc
bibliography: Artificial Intelligence-TFCA.bib
reference-section-title: Preliminary literature list
nocite: |
    @*

However, for me the filter specification in the YAML doesn't seem to work, so I still include the filter on the command line invocation: --filter pandoc-citeproc. Note that there are other filters for doing the same, but at the moment I haven't seen to need to look into them.

Two column layout

You can invoke the LaTeX two-column layout also by specifying metadata:

documentclass: article
classoption:
- twocolumn 

Tables in two column layout

pandoc uses the longtable package, but unfortunately this doesn't work in a two-column layout.

Other packages like supertable do manage, but in principle you'd have to adjust the latex template, which adds unnecessary complexity for such a minor issue. A better solution is to use a filter that swaps out longtable such that it works. I tried several solutions which all have their downsides, but this one works. The solution is to specify a preamble and include it to the template preamble, without having to edit the template, like such:

pandoc --filter pandoc-citeproc -H preamble.tex file.md -o file.pdf

I used this preamble:

\usepackage{supertabular}
\let\longtable\supertabular
\let\endlongtable\endsupertabular
\let\endhead\relax