pandoc does not print references when .bib file is in YAML

非 Y 不嫁゛ 提交于 2019-12-12 01:45:02

问题


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?


回答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.




回答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).



来源:https://stackoverflow.com/questions/41653335/pandoc-does-not-print-references-when-bib-file-is-in-yaml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!