我正在使用 bibtex 来组织我的参考书目。我想引用一本书中的一章。当一本书有作者和编辑时,我阅读的最佳方式是使用 crossref 以及 inbook 和 book 条目,例如:(bib_test.bib)
@inbook{inbook,
author = {A. Inbook-Author},
title = {The title of the inbook entry},
pages = {1--5},
chapter = {1},
crossref = "book",
}
@book{book,
title = {A title of the book entry},
booktitle = {A title of the book entry},
year = 2013,
editor = {E. Book-Editor},
publisher = {Book Publishing Inc.},
}
但是,如果我在 latex 文件上运行 bibtex
\documentclass{scrartcl}
\begin{document}
\cite{inbook}
\bibliographystyle{style}
\bibliography{bib_test}
\end{document}
它总是给我警告:
Warning--can't use both author and editor fields in inbook
我不明白这一点,因为这就是我将其拆分为 inbook 和 book 的原因,但我仍然收到此错误。在 bibstyle 文件中,我发现
FUNCTION {inbook}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check
}
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
title empty$ 'skip$ 'setup.inlinelink if$ % urlbst
format.btitle "title" output.check
format.edition output
crossref missing$
{
format.publisher.address output
format.bvolume output
format.chapter.pages "chapter and pages" output.check
format.number.series output
}
{
format.chapter.pages "chapter and pages" output.check
format.book.crossref output.nonnull
}
if$
format.date "year" output.check
date.block
format.pages "pages" output.check
format.doi output
format.note output
fin.entry
}
我测试了一些东西,似乎 crossref missing$ 总是给出 True 作为答案。如果给出了 crossref,他不应该测试作者和编辑者字段是否都存在。这很奇怪,因为他肯定能识别出 crossref,否则他会显示错误...
答案1
解决方案是将第一个条目的条目类型从 更改@inbook
为@inproceedings
。
\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@inproceedings{inbook,
author = {A. Inbook-Author},
title = {The title of the inbook entry},
pages = {1--5},
chapter = {1},
crossref = "book",
}
@book{book,
title = {A title of the book entry},
booktitle = {A title of the book entry},
year = 2013,
editor = {E. Book-Editor},
publisher = {Book Publishing Inc.},
address = "Anytown",
}
\end{filecontents}
\documentclass{article}
\bibliographystyle{style} % downloaded from site indicated by OP
\begin{document}
\cite{inbook}
\bibliography{mybib}
\end{document}