有没有办法覆盖特定条目的 bibtex 样式文件?
我最喜欢的 bibtex 样式文件通过作者姓名缩写引用。然而,有多种文本应该以不同的方式引用(例如,Elements Geometrie Algebrique 应始终引用为 [EGA])。我知道如何在 bibtex 输出的 .bbl 文件中修改它,但是我必须对每个文件执行此操作。有没有办法从我的 .bib 文件中执行此操作?
My preferred bibtex style file cites via author's initials. However, there are various texts which should be cited differently (for example, Elements Geometrie Algebrique should always be cited as [EGA]). I know how to modify this in the .bbl file that bibtex outputs, but then I have to do this for every file. Is there a way to do this from my .bib file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我希望我不会因此而受到批评,但是您喜欢的 bibtex 样式文件不能很好地为您的读者服务。我的部分工作是审阅论文,像 [GKS] 这样的一堆首字母缩写远不如 [Guibas, Knuth, and Sharir 1990] 这样完整的作者日期引用有用。对于知识渊博的读者来说,作者和日期通常使得没有必要参考参考书目。对于天真的读者来说,一组名称比一组字母更容易记住,尤其是当其中一个或多个名称可能很熟悉时。这些问题在芝加哥风格手册中进行了详细讨论,其中解释了正确的方法引用专业文献。
我之所以说这么长,是因为我相信你正在解决错误的问题。虽然我相信您的读者很快就会认识到[EGA],但我希望他们也能认识到(Grothendieck 1960)或(Grothendieck and Dieudonné 1967)。
如果您想使用任何标准 BibTeX 样式,则不需要。 BibTeX 使用世界上最糟糕的编程语言之一,并且标准程序对于使用作品的作者或编辑者来形成引文关键字非常严格。如果您确实想这样做,我建议您执行以下过程:
克隆并修改诸如
plainnat.bst
文件之类的内容。这将使您能够创建新的“参考书目样式”。创建一个新类型的 BibTeX 条目,使您能够使用特殊字段指定引文键(
key
是一个流行的选择)。更改
calc.label
函数以对新的条目类型执行正确的操作。如果幸运的话,更改calc.label
将足以确保事物正确排序。在
.bib
文件中使用非标准类型,并在所有 LaTeX 文档中使用非标准\bibliographystyle{...}
。诸神真的不希望你这样做——你的合著者也不希望你这么做……
I hope I don't get flamed for this, but your preferred bibtex style file does not serve your readers very well. Part of my job is to review papers, and a jumble of initials like [GKS] is not nearly as helpful as a full author-date citation like [Guibas, Knuth, and Sharir 1990]. For a knowledgeable reader, the authors and date often make it unneccessary to refer to the bibliography. For a naïve reader, a group of names is much easier to remember then a group of letters, especially when one or more of the names may be familiar. These issues are discussed in detail by, e.g., the Chicago Manual of Style, which explains the proper way to cite from the professional literature.
I go on at such length because I believe you are solving the wrong problem. Although I believe your readers will quickly recognize [EGA], I would hope they would also recognize (Grothendieck 1960) or (Grothendieck and Dieudonné 1967).
Not if you want to use any of the standard BibTeX styles. BibTeX uses one of the world's worst programming languages, and the standard programs are very firm about using the author or editor of a work for form the citation key. If you really want to do this, I recommend the following procedure:
Clone and modify something like the
plainnat.bst
file. This will enable you to create a new "bibliography style."Create a new type of BibTeX entry which will enable you to specify the citation key using a special field (
key
is a popular choice).Alter the
calc.label
function to do the right thing with your new type of entry. If you're lucky, changingcalc.label
will be enough to be sure the thing is sorted properly.Use your nonstandard type in your
.bib
file and use your nonstandard\bibliographystyle{...}
in all your LaTeX documents.The gods really don't want you to do this—and neither do your coauthors...
您可以修改 .bst 程序,以便它查找附加字段(例如 shown-key),如果设置了该字段,则使用该字段而不是通常的字段。
You can modify the .bst program so that it looks for an additional field, say shown-key, and if it is set uses that rather than the usual.
如果您愿意使用不同的围兜样式,答案指出了一种方法。使用摘要风格, bibtex 密钥用作引用密钥。然后,您可以根据需要编辑 bib 文件中的每个键。
这种方法的一个直接缺点是您必须编辑 bib 文件中的每个项目,但我相信为这种灵活性付出的代价是合理的。
我已经看到了涉及 natbib 或 biblatex 的其他可能的解决方案,但我想避免这些包,因为我在使用它们时有时会遇到编译问题。
If you are willing to use a different bib style there is a way pointed out by this answer. Using the abstract style, the bibtex key is used as the cite key. Then, you edit each key in the bib file anyway you want it.
A straightforward disadvantage of this approach is that you will have to edit every item in your bib file, however I believe that it is a fair price to pay for such flexibility.
I've seen other possible solutions involving natbib or biblatex, but I wanted to avoid those packages as I sometimes get compilation problems when using them.