Humans-of-Julia / BibParser.jl

Parser for bibliographic formats, including BibTeX, in pure Julia
MIT License
13 stars 5 forks source link

Difference between `BibParser.parse_entry` and `BibTeX.parse_bibtex` #30

Closed vandenman closed 1 year ago

vandenman commented 1 year ago

Consider the following example

bib = """
@misc{rstan2019,
    author        = {{Stan Development Team}},
    note          = {R package version 2.19.2},
    year          = {2019},
    url           = {http://mc-stan.org/},
    title         = {{RStan}: the {R} interface to {Stan}}
   }
"""

e1 = BibTeX.parse_bibtex(bib)
e1[2]["rstan2019"]["author"]
# "{ Stan Development Team }" # correct

e2 = BibParser.parse_entry(bib)
e2["rstan2019"].authors
# BibInternal.Name("", "Team}", "", "", "") # incorrect

The first entry appears correct, but the second is not. Note that this also propagates to Bibliography.jl.

Azzaare commented 1 year ago

Good catch! I need to parse names within braces as a specific case.

I think in the names formatting guide I used to write the parser, only names of people were considered, not the name of other entities.

EDIT: actually the problem stems from BibInternal.jl: https://github.com/Humans-of-Julia/BibInternal.jl/blob/083f10dbda2d06820cebde879fe0bff4eaa527d9/src/entry.jl#L25

The fix should be easy.

Azzaare commented 1 year ago

Should be fixed by a simple update of the julia environment (once the General Registry update).

Let me know, @vandenman , if some other modifications are needed.

lgoettgens commented 1 year ago

This issue is actually still present, as there hasn't been a release of BibInternals.jl since. Can somebody (maybe @Azzaare) do that?