20

I am trying to convert a simple LaTeX file that uses biblatex-chicago for citation formatting to, say, .docx via Pandoc. Unfortunately, I don't seem to be able to find the right invocation of Pandoc that results in a bibliography (or even the citations) included in the doc.

What I'm proposing doesn't have any complicated formulas, tables, or figures--just the bibliography. This question's author seems to have gotten the bibliography working with Pandoc, though it appears he's maybe using straight up bibtex with maybe the natbib citation commands.

Sample LaTeX (foo.tex):

% !TeX TS-program = pdflatexmk
% !BIB TS-program = biber

\documentclass[12pt,letterpaper]{article} % for a short document

% Bibliography
\usepackage[authordate,strict,bibencoding=inputenc,doi=true,isbn=false,backend=biber]{biblatex-chicago}
\addbibresource{./foo.bib}


\title{On Banality}
\author{Bob Dwyre}

\date{}

%%% BEGIN DOCUMENT
\begin{document}

\raggedbottom
\maketitle

People typically prefer to travel shorter distances than longer distances \parencite{zipf1946p1}. \textcite{dijkstra1959note} proposes one way of finding the shortest path.

\printbibliography
\end{document}

And a sample .bib (foo.bib):

@article{dijkstra1959note,
    Author = {Dijkstra, Edsger W},
    Date-Added = {2014-04-28 19:35:12 +0000},
    Date-Modified = {2014-04-28 19:35:12 +0000},
    Journal = {Numerische mathematik},
    Number = {1},
    Pages = {269--271},
    Publisher = {Springer},
    Title = {A note on two problems in connexion with graphs},
    Volume = {1},
    Year = {1959}}

@article{zipf1946p1,
    Author = {Zipf, George Kingsley},
    Date-Added = {2014-04-28 19:32:00 +0000},
    Date-Modified = {2014-04-28 19:32:00 +0000},
    Journal = {American sociological review},
    Pages = {677--686},
    Publisher = {JSTOR},
    Title = {The P1 P2/D hypothesis: On the intercity movement of persons},
    Year = {1946}}

My invocation of Pandoc is as follows, but I see nothing related to bibliography in the final output:

pandoc -o foo.docx foo.tex --biblatex --bibliography=foo.bib
2
  • Welcome to SX Peter! I was wondering if you've already tried to get a docx from a markdown file? Also, it's probably irrelevant, but I would invoke the pandoc command in this case as pandoc --biblatex --bibliography=foo.bib foo.tex -o foo.docx (pandoc pandoc-options input-file output-file).
    – aignas
    Apr 28, 2014 at 20:27
  • Thank you! I haven't tried markdown, but that's mainly because I prefer writing in LaTeX (it's a sickness, I know) and also I haven't bothered to learn the citation commands for Pandoc-flavored markdown yet.
    – Peter
    Apr 28, 2014 at 22:00

2 Answers 2

21

The --biblatex option only applies when the output document is LaTeX format. When I tried pandoc --bibliography=foo.bib -o foo.docx foo.tex it worked for me. If you want Chicago you need to add an option for that e.g. --csl=chicago-author-date.csl. You can get the CSL file from github.com/citation-style-language/styles.

1
  • 1
    Excellent! It looks like I was overcomplicating it. Also +1 for the --csl=chicago-author-date.csl invocation.
    – Peter
    Apr 28, 2014 at 22:02
8

I never got this example generating any citations on my Windows 10 machine. Only after adding --citeproc did the citations appear. For future reference one can try pandoc --bibliography=foo.bib -o foo.docx foo.tex --citeproc

1
  • This also worked for me. It seems there might have been a change since pandoc uses the citeproc library. Feb 27 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .