Subject: bug#69266: 30.0.50; bibtex-parse-entry misreads escaped \}

From: Ihor Radchenko <[email-masked]>
Date: Mon, 26 Feb 2024 17:08:31 +0000

Roland Winkler <[email-masked]> writes:

>> Would you reconsider this if Biber handles \} correctly?  I didn't
>> test it, though.
>
> I am happy to take advice from more advanced biber / biblatex users.
> For the fun of it, I just created my first LaTeX document using biber /
> biblatex.  That worked fine with balanced braces.  But it choked with a
> biber error message when a biblatex field contained a single "\{".
>
> Biber uses btparse to parse BibTeX files. The BibTeX data language, as
> recognized by btparse is explained here
>
> https://metacpan.org/dist/Text-BibTeX/view/btparse/doc/bt_language.pod
>
> My reading of this document is that btparse does no take steps to deal
> with "escaped braces" inside a field.

Well. btparse does not really try to implement bibtex syntax accurately.
The docs just say that there is no formal description other than the
code and give up, pointing that some more accurate parsers do exist, but
btparse is not one of these more accurate parsers.

That said, since bibtex itself chokes on \}, this bug report is notabug.

Also, talking about biblatex, I do note that
https://ctan.org/pkg/biblatex has a more detailed description of the
syntax with notable differences from bibtex. For example, biblatex
allows "crossref" field that defines entry inheritance; field aliases;
and special key-value format like
AUTHOR = {given=Hans, family=Harman and given=Simon, prefix=de, family=Beumont}
See https://ctan.org/pkg/biblatex

It would be nice to have those supported. I may open another bug report
if you think that this idea is worth tracking.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>