2

To compile a pdf with a bibtex bibliography, I thought it was sufficient to write the YAML as

---
title: super awesome paper
author: albert enstein
bibliography: /path/to/bib/file.bib
---

and punch this command into the terminal:

pandoc test.md -o test.pdf

But it does not work. Instead I have to manually add the bib file to the terminal command:

pandoc test.md --bibliography=/path/to/bib/file.bib -o test.pdf

What am I doing wrong?

invictus
  • 1,821
  • 3
  • 25
  • 30

3 Answers3

2

I believe you need to use the flag --filter pandoc-citeproc if you don't want to use the flag --bibliography=/path/to/bib/file.bib. This is because using the --bibliography= flag is equivalent to writing --metadata bibliography=FILE --filter pandoc-citeproc (https://pandoc.org/MANUAL.html#citation-rendering).

mdko
  • 33
  • 1
  • 3
1

There is nothing wrong with your syntax. So I suspect there are spaces somewhere in the path to the file.

A common error is that the variable does not accept spaces, so I would suggest to try bibliography: "/path/to/bib/file.bib" instead.

lf_araujo
  • 1,991
  • 2
  • 16
  • 39
0

Explicitly call the --citeproc argument to generate a list of references from the citations

pandoc article.md -o article.pdf --citeproc

Pandoc man page on citation rendering:

"-C, --citeproc Process the citations in the file, replacing them with rendered citations and adding a bibliography. Citation processing will not take place unless bibliographic data is supplied, either through an ex‐ ternal file specified using the --bibliography option or the bibliography field in metadata, or via a references section in metadata containing a list of citations in CSL YAML format with Markdown for‐ matting. The style is controlled by a CSL stylesheet specified using the --csl option or the csl field in metadata. (If no stylesheet is specified, the chicago-author-date style will be used by de‐ fault.) The citation processing transformation may be applied before or after filters or Lua filters (see --filter, --lua-filter): these transformations are applied in the order they appear on the com‐ mand line. For more information, see the section on Citations. "

Paul Rougieux
  • 10,289
  • 4
  • 68
  • 110