Pandoc无法正确转换LaTeX风格的引用

12

我想在我的Markdown文档中使用类似LaTeX的引用格式\cite{key},以便使用Pandoc创建漂亮的TeX和PDF文档。但是,当我引用一些内容时,它显示方括号中的关键字而不是引用样式,例如作者姓名或引用编号。换句话说,我希望在PDF文档中显示为"This is my citation [1]",但实际上它显示为"This is my citation [mykey]"。此外,在添加了# References标题后,我的参考文献列表没有显示出来。这是怎么回事?

下面是我用于生成此内容的示例命令,以及示例文件和当前不正确的输出文件(test.pdf)。

pandoc test.md --biblatex --biblio test.bib --csl chicago-author-date.csl -o test.pdf

test.md

% My test pandoc-ument

I want to reference this: \cite{Gepasi1993}

# References

test.bib

@ARTICLE{Gepasi1993,
    Author         = {P. Mendes},
    Journal        = {Comput. Applic. Biosci.},
    Pages          = {563--571},
    Title          = {GEPASI: A software package for modelling the dynamics, steady states and control of biochemical and other systems.},
    Volume         = {9},
    Year           = {1993}
}

测试.pdf

I want to reference this: [Gepasi1993]
1个回答

26

--biblatex选项不是用于直接在markdown中编写biblatex的。它的作用是将本地pandoc markdown引用转换为biblatex格式,例如

[@Gepasil1993, p. 5] 

将biblatex引用转换为LaTeX输出。

如果您使用pandoc markdown引用而不是LaTeX引用,则会发现引用正常工作。请使用以下命令:

pandoc test.md --biblio test.bib --csl chicago-author-date.csl -o test.pdf 

使用此输入:

I want to reference this: [@Gepasi1993] 

Pandoc的引用格式在Pandoc用户指南中有详细文档记录。
如果您确实想在Markdown输入中使用原始的biblatex引用,您可以这样做,但是您需要自己处理参考文献相关内容。您可以按以下方式操作:
pandoc test.md --parse-raw -t latex -s > test.tex 
pdflatex test 
biber test 
pdflatex test 
pdfltatex test 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接