4

I'm using the beilstein.cls class from the beilstein package to format a document. The references in these documents are formatted using the bjnano.bst style file that comes with the beilstein package from CTAN (https://ctan.org/pkg/beilstein). In my document I'm referencing an InProceedings-type reference, which causes the following error with 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)

In spite of the error, a proper bibliography is created and the entry seems to be completely there. I had a look at line 1463 of the style file, however I do not understand the way the formatting works.

Here is the corresponding 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}

Does the error exist within the style file or does my .bib file contain an error?

EDIT: As pointed out by the package maintainer in an answer below, this bug exists in version 2.0 (dated 2020-02-26) and will be fixed with a new version update.

3
  • Welcome to TeX.SE.
    – Mico
    Aug 24 '20 at 15:27
  • A quick fix (not a full solution): change the entry type from @inproceedings to @incollection.
    – Mico
    Aug 24 '20 at 15:41
  • 2
    Unrelated: you don't need the extra brackets around the author names or around IEEE, and the empty volume and number fields can be removed.
    – Marijn
    Aug 24 '20 at 15:53
6

There is a small bug in the inproceedings function in bjnano.bst.

After printing the booktitle the function calls add.semicolon write$ (line 1121). At this point apparently the stack is empty, therefore the error occurs. Replacing the line with new.block (which also prints a semicolon) the error disappears, while the output remains the same.

Full function without the error:

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
}
1

Thanks for the report. An updated version 2.1 has just been sent to CTAN.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.