FlamingTempura / bibtex-tidy

Cleaner and Formatter for BibTeX files
https://flamingtempura.github.io/bibtex-tidy/
MIT License
859 stars 66 forks source link

Error in Entry Parsing #358

Closed damianoazzolini closed 2 years ago

damianoazzolini commented 2 years ago

I've noticed that, when the name of the entry (or the DOI?) contains (, the tool throws an error. Consider this entry

@article{10.1016/0196-6774(89)90038-2,
    author = {Karp, R. M. and Luby, M. and Madras, N.},
    title = {Monte-Carlo Approximation Algorithms for Enumeration Problems},
    year = {1989},
    issue_date = {September 1989},
    publisher = {Academic Press, Inc.},
    address = {USA},
    volume = {10},
    number = {3},
    issn = {0196-6774},
    url = {https://doi.org/10.1016/0196-6774(89)90038-2},
    doi = {10.1016/0196-6774(89)90038-2},
    journal = {J. Algorithms},
    month = sep,
    pages = {429--448},
    numpages = {20}
}

This is the entry you can download from the Elsevier website: https://www.sciencedirect.com/science/article/abs/pii/0196677489900382 I get

BibTeXSyntaxError [Syntax Error]: Line 1:27: Syntax Error in entry
le{10.1016/0196-6774>>(<<89)90038-2,
FlamingTempura commented 2 years ago

Thanks - I've just pushed a fix that will permit parentheses in the citation key.