-
Notifications
You must be signed in to change notification settings - Fork 0
Description
It turns out that if a bibtex entry contains either \textsuperscript or \textsf in a field, then the parse will fail on that block. The reason is because these are not handled by the version of pylatexenc that we are using (textsf was apparently added in 2.0.10). I think this corresponds to 2.0.0b8 in pypi which was released in Dec 2024. The bibtexparser library seems to have been evolving slowly and I suspect there will always be macros that are not recognized. The error handling in bibtexparser is also pretty strange because sometimes it puts things out to stderr and sometimes it outputs a ParsingFailedBlock.
I think my error handling needs to be better, because it should pass any unknown macros through cleanly. Right now the _illegal_handler is invoked if it encounters an unknown macro and raises a ValueError (more lenient code is commented out for reasons I don't remember). I should write better tests for this and cc2-1-17 provides a good test case. Even after 40 years, the only definition of the bibtex grammar is still unfortunately in the source code for the bibtex tool, which is written in web2c.