bibtex 與 inbook 和 book crossref:為什麼 crossref 丟失$ = True,儘管 crossref 被識別?

bibtex 與 inbook 和 book crossref:為什麼 crossref 丟失$ = True,儘管 crossref 被識別?

我正在使用 bibtex 來組織我的參考書目。我想引用一本書中的一個章節。當一個人既有作者又有編輯時,我閱讀的最佳方法是使用交叉引用以及書內和書籍條目,例如:(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.},
}

但是,如果我在乳膠文件上運行 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

我不明白這一點,因為這就是我將其分為書本和書籍的原因,但我仍然收到此錯誤。在 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 作為答案。如果給出了交叉引用,他不應該對作者和編輯字段都存在進行測試。這很奇怪,因為他肯定能識別交叉引用,否則他會顯示錯誤...

答案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}

相關內容