python-bibtexparser icon indicating copy to clipboard operation
python-bibtexparser copied to clipboard

getnames incorrectly parsing names with braces

Open edwardabraham opened this issue 11 years ago • 3 comments

Sometimes names have braces, and these aren't understood by getnames. For example,

getnames(['A. {Delgado de Molina}']) returns ['de Molina}, A. {Delgado']

instead, it should return ['Delgado de Molina, A.']

edwardabraham avatar Nov 27 '13 21:11 edwardabraham

OK. I have got things working by using non-breaking spaces to group the names together, rather than braces, e.g., Delgado~de~Molina

edwardabraham avatar Nov 27 '13 22:11 edwardabraham

Note:

Before I found this, I wrote a fairly complete author list parser, that I would like to contribute here.

But now taking a look at customization.getnames, and a few comments:

I see the note that says it's incomplete, so that's a start.

But I also see:

""" """Convert people names as surname, firstnames or surname, initials. """

Which is a key problem -- BibTeX is pretty smart about names, and so you can't do just first and last.

From what I can see from the docs, it breaks down names into four components, so that it can then, later on, do the bibliography formatting right:

first, von, jr, last

Anyway, I have written (Ugly, complicated) code that deals with all of this, and a set of tests that pass every example in "The LaTeX Companion" -- which has quite fe ugly examples.

Should I take the time to figure out how to integrate this with bibtexparser and do a PR?

ChrisBarker-NOAA avatar Nov 16 '16 22:11 ChrisBarker-NOAA

aarrgg! I had seen getnames, but somehow did not see splitname() which is very much doing "the right thing"

I already integrated my version with my fork of the code.

But splitnames looks be be a cleaner implementation -- so I"ll run al my tests on it, and see where that leads us.

Maybe a PR will be coming.

ChrisBarker-NOAA avatar Nov 17 '16 00:11 ChrisBarker-NOAA