4

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?

tarleb
  • 19,863
  • 4
  • 51
  • 80
user855443
  • 2,596
  • 3
  • 25
  • 37
  • Once the bibliography has been specified in the yaml front matter, you still need to explicitly call the `--citeproc` argument to generate a list of references from the citations `pandoc article.md -o article.pdf --citeproc`. – Paul Rougieux Aug 17 '23 at 08:33
  • Does this answer your question? [pandoc does not print references when .bib file is in YAML](https://stackoverflow.com/questions/41653335/pandoc-does-not-print-references-when-bib-file-is-in-yaml) – Paul Rougieux Aug 17 '23 at 08:42
  • I read and referenced this question; it does not cover the use case I have. – user855443 Aug 18 '23 at 13:33
  • Adding the `--citeproc`argument to the pandoc invocation does generate a list of references from the article's citation. This works also when the bibliography is specified in the YAML front matter. – Paul Rougieux Sep 01 '23 at 08:30

2 Answers2

5

In the more recent version requires --citeproc instead of --filter=pandoc-citeproc

Saikat Roy
  • 111
  • 1
  • 5
1

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.

tarleb
  • 19,863
  • 4
  • 51
  • 80
  • 1
    Perfect. It would be valuable, if the documentation would make this clear. Thank you a lot! – user855443 Jan 11 '19 at 20:20
  • Is it possible to run the citeproc process separately after pandoc was running? My use case is the conversion to HTML. I would need something like: `run pandoc ...; run citeproc .... `, i.e. a sequence of runs. – user855443 Jan 12 '19 at 08:51
  • 1
    No, because pandoc-citeproc needs to be run on pandoc's internal data structure. Can you describe your use case in more detail (idealy in a new question)?Maybe citeproc.js is an option for you. – tarleb Jan 12 '19 at 10:09
  • 1
    Thank you for the explanation. I can run the pandoc as described but adding citeproc as a filter would have been even easier. I checked the citeproc.js webpage and do not see how citeproc.js would simplify my application beyond what you have suggested with running pandoc with the --filter=pandoc-citeproc switch. – user855443 Jan 12 '19 at 12:01