bjnano.bst 導致 @Inproceedings 出現「您無法彈出條目 XXX 的空文字堆疊」錯誤

bjnano.bst 導致 @Inproceedings 出現「您無法彈出條目 XXX 的空文字堆疊」錯誤

我正在使用貝爾斯坦.cls類別來自貝爾施泰因包以格式化文件。這些文件中的參考文獻的格式使用北京納米科技有限公司附帶的樣式文件貝爾施泰因來自 CTAN 的包(https://ctan.org/pkg/beilstein)。在我的文件中,我引用了 InProceedings 類型的引用,這會導致 bibtext 出現以下錯誤:

This is BibTeX, Version 0.99d (MiKTeX 20.7)
The top-level auxiliary file: co-paper-MWE.aux
The style file: bjnano.bst
Database file #1: MWE.bib
You can't pop an empty literal stack for entry 5420955
while executing---line 1463 of file bjnano.bst
(There was 1 error message)

儘管存在錯誤,但仍創建了正確的參考書目,並且條目似乎完全存在。我查看了樣式檔案的第 1463 行,但我不明白格式化的工作方式。

這是對應的 MWE:

\documentclass{beilstein}
\usepackage{filecontents}
\begin{filecontents*}{MWE.bib}
@INPROCEEDINGS{5420955,
    author={J. J. {Martin} and V. {Neburchilov} and H. {Wang} and W. {Qu}},
    booktitle={2009 IEEE Electrical Power Energy Conference (EPEC)}, 
    title={Air cathodes for metal-air batteries and fuel cells}, 
    year={2009},
    volume={},
    number={},
    pages={1-6},
    publisher={{IEEE}},
    doi = {10.1109/epec.2009.5420955},}
\end{filecontents*}

\begin{document}
    Text\cite{5420955} 
    \bibliography{MWE}
\end{document}

樣式檔案中是否有錯誤,或者我的 .bib 檔案是否包含錯誤?

編輯:正如套件維護者在下面的回答中指出的,此錯誤存在於版本 2.0(日期為 2020-02-26)中,並將透過新版本更新修復。

答案1

inproceedings中的函數有一個小錯誤bjnano.bst

列印書名後,函數呼叫add.semicolon write$(第 1121 行)。此時堆疊顯然為空,因此發生錯誤。將行替換為new.block(也列印分號)錯誤就會消失,而輸出保持不變。

功能齊全,無錯誤:

FUNCTION {inproceedings}
{ output.bibitem
  format.authors "author" output.check
  after.item 'output.state :=
  title empty$
    'skip$
    { title format.title.noemph output
      after.sentence 'output.state :=
    }
  if$
  booktitle format.proc.title.in "booktitle" output.check
  new.block
  format.pub.address "publisher" output.check
  format.bdate "year" output.check
  pages empty$
    'skip$
    { new.block
      format.pages output }
  if$
  format.doi output
  fin.entry
}

答案2

感謝您的報告。更新版本 2.1 剛發送至 CTAN。

相關內容