2

Whenever I have a pandoc markdown file that I am converting to PDF or HTML, and it contains a reference to a large biblatex file (> 100 KB) for citations, the performance is incredibly slow. I end up needing to convert directly to tex first and then running regular latex commands, e.g. latex, bibtex, latex, pdflatex.

For example, if I have two files refs.bib and test.md, this following command takes forever to run;

pandoc test.md -o test.pdf --bibliography refs.bib

or

pandoc test.md -o test.html --bibliography refs.bib

My current workaround is to instead to export to latex and then run latex commands directly:

pandoc test.md -o test.tex --bibliography refs.bib
latex test.tex
bibtex test.aux
latex test.tex
pdflatex test

What is going on with the performance of using pandoc? My understanding was that essentially these were the same calls going on in the background.

I have created a Gist that contains the test files.

user1027169
  • 2,627
  • 3
  • 27
  • 50

1 Answers1

3

I believe the slowdown is due to the fact that pandoc has to call citeproc-hs, which has to call bibutils, which has to convert the entire bibtex file to the native citeproc format.

The easiest way to speed things up, at the moment, is to write a script that extracts the relevant bibtex entries to a temporary file, and runs pandoc against that. This thread on the pandoc-discuss mailing list includes links to some scripts that do this:

David Sanson
  • 136
  • 1
  • 4