GNU bug report logs -
#69266
30.0.50; bibtex-parse-entry misreads escaped \}
Previous Next
Reported by: Ihor Radchenko <yantar92 <at> posteo.net>
Date: Mon, 19 Feb 2024 09:12:02 UTC
Severity: normal
Found in version 30.0.50
Done: Roland Winkler <winkler <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 69266 <at> debbugs.gnu.org (full text, mbox):
Ihor Radchenko <yantar92 <at> posteo.net> writes:
> According to https://www.bibtex.org/SpecialSymbols/, characters that
> conflict with Bibtex format description can be \-escaped.
I believe the above webpage is incorrect. If I put something like \}
into a BibTeX field, BibTeX complains about unbalanced braces.
This is with BibTeX, Version 0.99d (TeX Live 2022/Debian).
The parsing algoritm used by BibTeX is very simple. Generally,
BibTeX fields should contain valid LaTeX code. So something
like
title = "$\}$tex",
should work with BibTeX, but it gives the same error message
"unbalanced braces".
Emacs bibtex mode follows the capabilities of BibTeX itself. I believe
it would not make sense to try to be smarter than that if, in the end,
this is not compatible anymore with BibTeX itself.
I guess one could submit here a bug report / feature request for BibTeX.
But BibTeX has been around for many decades with this limited feature set.
Nowadays, there is also biblatex. It's intended as a successor for
BibTeX. But it is something I know little to nothing about because in
my world (physics), everyone I know still uses BibTeX. Essentially,
biblatex entries still use the same format as BibTeX entries. I do not
know whether biblatex would deal with something like the above in a
smarter way.
These BibTeX fields should contain valid LaTeX code. But from (La)TeX's
perspective, in the string "$\}$" the backslash is not an escape
character for what follows, but \} is a macro that's defined inside TeX
math mode. Also, the meaning of the statement "valid LaTeX code" can be
heavily redefined within (La)TeX. Take a look at texinfo files that TeX
can digest. So a smart BibTeX parser would require (La)TeX itself working
in the background.
In practical terms (for many years) I have never experienced this to be
a constraint when working with BibTeX. So changing / improving this may
have a low priority among BibTeX / biblatex maintainers.
This bug report was last modified 218 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.