【问题标题】:pandoc does not produce bibliography when biblio file is in YAML-metadata only当 biblio 文件仅在 YAML 元数据中时,pandoc 不会生成参考书目
【发布时间】:2019-01-11 17:21:50
【问题描述】:

我假设在 YAML 元数据中插入对 BibTex 书目的引用足以生成引用。这就像pandoc does not print references when .bib file is in YAML,可能被误解了,还没有被接受的答案。

我有示例输入文件:

---
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

我调用转换为乳胶:

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

生成了 pdf,但它不包含引用,并且文本呈现为 With a reference to [@Frank2010a] and more.,表明未使用引用文件。标题和作者被插入到 pdf 中,因此 YAML 元数据被读取。如果我在命令行上添加参考文件,则输出将与参考列表一起正确生成。

我做错了什么?我想避免在命令行上指定参考书目文件(作为重复,DRY)。是否有一般的切换来要求书目处理并将书目文件的选择留给文档 YAML-metada?

【问题讨论】:

    标签: pandoc pandoc-citeproc


    【解决方案1】:

    在较新的版本中需要--citeproc 而不是--filter=pandoc-citeproc

    【讨论】:

      【解决方案2】:

      Theo 参考书目由 pandoc-citeproc 过滤器插入。通过命令行设置参考书目时它将自动运行,但在您的情况下必须手动运行。 Addind --filter=pandoc-citeproc 将使其按预期工作。

      【讨论】:

      • 完美。如果文档能清楚地说明这一点,那将是有价值的。非常感谢!
      • pandoc运行后是否可以单独运行citeproc进程?我的用例是转换为 HTML。我需要类似:run pandoc ...; run citeproc .... ,即一系列运行。
      • 否,因为 pandoc-citeproc 需要在 pandoc 的内部数据结构上运行。您能否更详细地描述您的用例(最好是在一个新问题中)?也许 citeproc.js 是您的一个选择。
      • 感谢您的解释。我可以按照描述运行 pandoc,但添加 citeproc 作为过滤器会更容易。我检查了 citeproc.js 网页,但没有看到 citeproc.js 将如何简化我的应用程序,超出您建议使用 --filter=pandoc-citeproc 开关运行 pandoc 的方法。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-25
      • 1970-01-01
      相关资源
      最近更新 更多