jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.86k stars 3.39k forks source link

Using the "bibliography" YAML parameter doesn't work #6713

Closed axelkennedal closed 4 years ago

axelkennedal commented 4 years ago

I'm trying to write a report using Pandoc with Markdown and bibtex. When compiling the document using bibliography as a parameter like so: pandoc thesis.md -o test.pdf --bibliography references.bib all is well. But when trying to put the parameter in the YAML portion of my Markdown;

---
bibliography: references.bib
---

and compiling like so; pandoc thesis.md -o test.pdf

the citations are not rendered in test.pdf.

This despite the fact that the documentation tells me it should be possible.

tarleb commented 4 years ago

I think you may have missed the documentation for --bibliography (emphasis mine):

--bibliography=FILE

Set the bibliography field in the document's metadata to FILE, overriding any value set in the metadata, and process citations using pandoc-citeproc. (This is equivalent to --metadata bibliography=FILE --filter pandoc-citeproc.) If --natbib or --biblatex is also supplied, pandoc-citeproc is not used, making this equivalent to --metadata bibliography=FILE. If you supply this argument multiple times, each FILE will be added to bibliography.

Add --filter=pandoc-citeproc to your command and it will work.

axelkennedal commented 4 years ago

I guess my brain was in airplane mode when looking at the docs, my bad!