Search code examples
pandocpandoc-citeproc

pandoc does not produce bibliography when biblio file is in YAML-metadata only


I assume that inserting a reference to a BibTex bibliography in a YAML-metadata is sufficient for the references to be produced. This is like pandoc does not print references when .bib file is in YAML, which was perhaps misunderstood and which has no accepted answer yet.

I have the example input file:

---
title: Ontologies of what?
author: auf 
date: 2010-07-29
keywords: homepage
abstract: | 
    What are the objects ontologists talk about. 
    Inconsistencies become visible if one models real objects (cats) and children playthings.
bibliography: "BibTexExample.bib"
---

An example post. With a reference to [@Frank2010a] and more.

## References

I invoke the conversion to latex with :

pandoc -f markdown -t pdf  postWithReference.markdown -s --verbose -o postWR.pdf -w latex

The pdf is produced, but it contains no references and the text is rendered as With a reference to [@Frank2010a] and more. demonstrating that the reference file was not used. The title and author is inserted in the pdf, thus the YAML-metadata is read. If I add the reference file on the command line, the output is correctly produce with the reference list.

What am I doing wrong? I want to avoid specifying the bibliography file (as duplication, DRY) on the command line. Is there a general switch to demand bibliography processing and leaving the selection of the bibliography file to the document YAML-metada?


Solution

  • Theo bibliography is inserted by the pandoc-citeproc filter. It will be run automatically when biblioraphy is set via the command lines, but has to be run manually in cases such as yours. Addind --filter=pandoc-citeproc will make it work as expected.