[Tex/LaTex] Latex default citation and bibliography style with Pandoc

bibtexpandoc

I write a paper in Markdown and convert it to PDF via Pandoc and Latex with the following commands to get Latex's (well, BibLatex's) default citation and bibliography style:

pandoc -s --bibliography=foo.bib --biblatex -o foo.tex foo.md
pdflatex foo.tex
bibtex foo.aux
pdflatex foo.tex
pdflatex foo.tex

Of course I could just let Pandoc produce a PDF file directly like this:

pandoc --bibliography=foo.bib --csl=foo.csl -o foo.pdf foo.md

However, despite an extensive search on zotero.org/styles I did not find a CSL style that

  1. closely matches Latex's default citation style "plain" (with inline citations like "blah blah [1]") and
  2. produces bibliography entries that are suited for a German document (with pages abbreviated as "S." instead of "pp.", publishers as "Hrsg." instead of "Eds.", etc.) without errors like missing dots after abbreviations and the like.

So here's my question:

Is there an easier way to use native Latex citation and bibliography stuff via Pandoc than the commands above? I don't care about typing more or less commands (Makefile ftw), I just wonder if it's necessary to create an intermediate Latex file at all.

Alternatively, can anybody point me to a decent CSL file for German (Computer Science) texts?

Best Answer

After some more experiments and reading documentation I am pretty sure there is no way to avoid creating an intermediate Latex file if one wants to use native Latex citation and bibliography power.

The reason is with Pandoc we can apparently use one of two possible techniques to produce bibliographic references: Either CSL files (with the --csl setting) or Latex citations (with the --biblatex or --natbib settings). CSL files can be used with every output format, Latex citations can only be used if the output format is, well, Latex.

But why? Because when creating Latex output with the --biblatex or --natbib settings, Pandoc converts Markdown references like [@foo, p. 20] into Latex commands like \autocites[p. 20]{foo}. When converting the Latex file to PDF, these commands will be processed by pdflatex and thus produce the beautiful output I am looking for. Obviously, creating such Latex commands in any other output format would be rather vain.

When invoked with the --csl option, on the other hand, Pandoc directly converts Markdown references like the above into text like "(Knuth 1970, p. 20)", depending on the CSL style. This is actually pretty cool because that way the citations will be "hardcoded" and thus look like they are specified in the CSL file in every output format. The drawback is of course that if I do not find a CSL file that suits my needs, I have to go the Markdown -> Latex -> PDF way.

What still makes me wonder is why the --biblatex and --natbib settings cannot be used when creating PDF output. If I am not mistaken, Pandoc produces PDF via Latex anyway, so why not use the full power of Latex? But anyway, I think I can totally live with the way described in my question ;-)