如何使用 BibTeX 按外观对引文进行排序?
默认情况下(使用 plain
样式)BibTeX 按字母顺序对引文进行排序。
如何按文档中出现的顺序对引文进行排序?
By default (using the plain
style) BibTeX orders citations alphabetically.
How to order the citations by order of appearance in the document?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(13)
这个问题有三个很好的答案。
unsrt
参考书目样式,否则makebst
(link) 工具来设计您自己的参考书目风格我个人的建议:
biblatex
包 (链接)。 它是 LaTeX 世界中最完整、最灵活的参考书目工具。使用
biblatex
,你可以写类似的东西There are three good answers to this question.
unsrt
bibliography style, if you're happy with its formatting otherwisemakebst
(link) tool to design your own bibliography styleAnd my personal recommendation:
biblatex
package (link). It's the most complete and flexible bibliography tool in the LaTeX world.Using
biblatex
, you'd write something like更改
为
“然后重建它几次”以替换使用普通样式时生成的
.aux
和.bbl
文件。或者只需删除
.aux
和.bbl
文件并重建。如果您使用 MiKTeX,则无需下载任何额外内容。
Change
to
Then rebuild it a few times to replace the
.aux
and.bbl
files that were made when you used the plain style.Or simply delete the
.aux
and.bbl
files and rebuild.If you use MiKTeX you shouldn't need to download anything extra.
我想到的最好的办法是使用
unsrt
样式,这似乎是一种经过调整的plain
样式。 即但是如果我的样式不是默认样式怎么办?
The best I came up with is using the
unsrt
style, which seems to be a tweakedplain
style. i.e.However what if my style is not the default?
只是一个简短的说明 - 我正在使用 plain.bst 的修改版本位于包含我的 Latex 文件的目录中; 事实证明,按出现顺序排序是一个相对容易的更改; 只需找到一段代码:
...并对其进行评论 - 我将其变成:
...然后,在运行
bibtex
,pdflatex
,pdflatex< /code> - 引文将按出现顺序排序(也就是说,它们将不排序:))。
干杯!
编辑:刚刚意识到我写的实际上是在 @ChrisN 的评论中:“你可以编辑它以删除 SORT 命令”;)
Just a brief note - I'm using a modified version of plain.bst sitting in the directory with my Latex files; it turns out having sorting by order of appearance is a relatively easy change; just find the piece of code:
... and comment it - I turned it to:
... and then, after running
bibtex
,pdflatex
,pdflatex
- the citations will be sorted by order of appearance (that is, they will be unsorted :) ).Cheers!
EDIT: just realized that what I wrote is actually in the comment by @ChrisN: "can you edit it to remove the SORT command" ;)
您回答了自己的问题——当您希望对 ne 的引用按出现顺序列出时,请使用
unsrt
。但您可能还想看看 natbib ,一个极其灵活的引文包。 我无法想象没有它的生活。
You answered your own question---
unsrt
is to be used when you want references to ne listed in the order of appeareance.But you might also want to have a look at natbib, an extremely flexible citation package. I can not imagine living without it.
我对 Bibtex(以及一般的 Latex)有点陌生,我想重温这篇旧文章,因为我发现它出现在我的许多关于 Latex 中参考书目排序的 Google 搜索查询中。
我对这个问题提供了更详细的答案,希望它可以帮助一些和我面临同样困难的新手。
以下是调用参考书目的主 .tex 文件的示例:
...以及 .bib 文件本身的示例:
请注意 .bib 文件中的引用以相反的顺序列出,但引用列在它们在论文中被引用的顺序。
有关 .bib 文件格式的更多信息,请访问:http://en.wikibooks。 org/wiki/LaTeX/Bibliography_Management
I'm a bit new to Bibtex (and to Latex in general) and I'd like to revive this old post since I found it came up in many of my Google search inquiries about the ordering of a bibliography in Latex.
I'm providing a more verbose answer to this question in the hope that it might help some novices out there facing the same difficulties as me.
Here is an example of the main .tex file in which the bibliography is called:
...and an example of the .bib file itself:
Note the references in the .bib file are listed in reverse order but the references are listed in the order they are cited in the paper.
More information on the formatting of your .bib file can be found here: http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
我经常使用参考书目风格
natbib
因为它为我们提供了相当完整的格式和标签集。I often use the bibliography style
natbib
because it supplies quite complete set of formats as well as tags for us.如果您希望引用数量在文档中按顺序显示,请添加此项
它们只会在参考页面中未排序:
Add this if you want the number of citations to appear in order in the document
they will only be unsorted in the reference page:
我在背面使用了以下内容并按升序排列:
\usepackage{cite}
\bibliographystyle{unsrt}
I used the following in overleaf and become in ascending order:
\usepackage{cite}
\bibliographystyle{unsrt}
对于
unsrt
,问题在于格式。 使用\bibliographystyle{ieeetr}
按文档中引用的顺序获取参考文献。with
unsrt
the problem is the format. use\bibliographystyle{ieeetr}
to get refences in order of citation in document.如果您碰巧使用
amsrefs
,它们将覆盖上述所有内容 - 因此请注释掉:\usepackage{amsrefs}
If you happen to be using
amsrefs
they will override all the above - so comment out:\usepackage{amsrefs}
datatool 包提供了一种按任意标准对参考书目进行排序的好方法,首先将其转换为某种数据库格式。
简短的示例,取自此处并发布记录:
The datatool package offers a nice way to sort bibliography by an arbitrary criterion, by converting it first into some database format.
Short example, taken from here and posted for the record:
我将
natbib
与bibliographystyle{apa}
结合使用。 例如:I use
natbib
in combination withbibliographystyle{apa}
. Eg: