bibtex icon indicating copy to clipboard operation
bibtex copied to clipboard

Parsing silently fails in case text between entries in bibfile

Open stmichaelis opened this issue 1 year ago • 0 comments

In case where there is text outside of entries, parsing silently fails and no entries are parsed. Example, which delivers 0 entries after parsing:

% Encoding: UTF-8
@article{CitekeyArticle,
  author   = "John Doe",
  title    = "The independence of the continuum hypothesis",
  journal  = "Proceedings of the National Academy of Sciences",
  year     = 1963,
  volume   = "50",
  number   = "6",
  pages    = "1143--1148",
}

While I do not see any reason for text outside of entries, it appears some bibliography tools are adding other forms of comments nevertheless. While this is considered garbage from a BibTeX/BibLaTeX point of view, they are still able to process the entries anyway.

Specifications seem to allow text between entries as well, e.g. see: https://tex.stackexchange.com/questions/21709/comments-in-bibtex and section 4.7: https://texdoc.org/serve/btxdoc/0

This parser should either throw an error on parsing or discard any text between entries.

stmichaelis avatar Apr 11 '24 08:04 stmichaelis