如何在pandoc的书目参考中逃避“:”?

时间:2014-01-07 19:35:56

标签: haskell markdown pandoc bibtex bibliography

基本上,有一个bibtex文件由Zotero 4.0.17自动生成,我用它来生成markdown文件中的参考书目。使用的工具是pandoc-1.12.1和pandoc-citeproc-0.2。

这是名为notes.md

的降价文件
# State of the art

 - Wikipathways [@pico_wikipathways\:_2008]

# Bibliography

<!-- TODO is this usefull?
bibliography::research.bib -->
<!-- \bibliography{research} So that RefTeX knows about the bibliography -->

这是名为research.bib

的bibtex文件
@ARTICLE{pico_wikipathways:_2008,
 author = {Pico, Alexander R and Kelder, Thomas and van Iersel, Martijn P and Hanspers, Kristina and Conklin, Bruce R and Evelo, Chris},
 title = {{WikiPathways:} Pathway Editing for the People},
 journal = {{PLoS} Biol},
 year = {2008},
 volume = {6},
 pages = {e184},
 number = {7},
 month = jul,
 abstract = {{WikiPathways} provides a collaborative platform for creating, updating, and sharing pathway diagrams and serves as an example of content  curation by the biology community.},
 doi = {10.1371/journal.pbio.0060184},
 keywords = {\_tablet},
 shorttitle = {{WikiPathways}},
 url = {http://dx.doi.org/10.1371/journal.pbio.0060184},
 urldate = {2013-11-20}
}

这是我运行的命令

pandoc --bibliography=research.bib notes.md -o notes.md.pdf

我期待一切顺利,但:字符的存在使得PDF的生成成功,并出现以下错误

pandoc-citeproc: reference pico_wikipathways not found

PDF的参考书目不正确。

知道如何逃避:中的notes.md以便识别出书目参考?

2 个答案:

答案 0 :(得分:4)

您必须更改密钥。 Pandoc的引文键解析器当前不允许一行中包含多个非字母数字符号,因此:_的键失败。另外,请勿在引文键中:之前使用反斜杠。

答案 1 :(得分:0)

从版本1.12.3开始,此问题已修复。使用

卸载当前版本
sudo rm -f /usr/local/bin/pandoc /usr/local/doc/pandoc-1.9.4.2 /usr/local/share/man/man1/pandoc.1.gz /usr/local/share/man/man5/pandoc_markdown.5.gz /usr/local/share/pandoc-1.9.4.2

然后重新安装pandoc,你应该好好去。