0

当我将降价文件转换为 pdf 时,参考书目中的参考顺序与文件中的顺序相同.bib。结果,文本中的引用以错误的顺序出现。结果,我可以在文本中使用类似... reported in [2] after [1] ... while 我希望参考文献在参考书目中出现在文本中时那样的句子,因为它会使用unsrt.bib.

问题是:如何按照它们在文本中出现的顺序对参考书目部分中的条目进行排序?

MWE,使用编译pandoc -C -f markdown testing.md -o testing.pdf

测试.md:

---
bibliography: test.bib
csl: aps.csl
---

The first reference [@second_title_2015]

The second reference [@author_title_2014]

测试.bib

@article{author_title_2014,
  title = {The title},
  author = {Author, A. B. and Other, C. D.},
  year = {2014},
}

@article{second_title_2015,
  title = {The other title},
  author = {Second, T. A. and First, F. G.},
  year = {2015},
}

输出

参考文献顺序说明

更改@article's in的顺序会test.bib产生所需的输出:The first reference [1] the second reference [2].

我正在使用aps.csl取自 zotero 样式存储库: https ://www.zotero.org/styles/american-physics-society?source=1

问题的原因

我有一个由 conda 安装的过时 pandoc(pandoc 是我需要的一些重要包的先决条件),并且这个版本优先于默认的 arch 安装,因为 conda 的可执行文件目录在$PATHbefore中/bin/

4

1 回答 1

2

您是否使用过时的 pandoc?我用 pandoc 2.13 测试了你的代码,它产生了正确的输出。您可以在此处获取最新版本。

pandoc --version
pandoc 2.13
Compiled with pandoc-types 1.22, texmath 0.12.2, skylighting 0.10.5,
citeproc 0.3.0.9, ipynb 0.1.0.1

pandoc -C -f markdown testing.md -o testing.pdf

在此处输入图像描述

于 2021-04-20T17:06:46.213 回答