Bug: tilde in "\~" is parsed as space
Issue #64
resolved
There seems to be a bug in pybtex/bibtex/utils.py
in split_tex_string()
, where a name such as 'Brand\~{a}o'
gets incorrectly split because of the ~
character. Here, the ~
is part of the escape sequence \~
and is not a space.
I'm using pybtex to parse bibtex files (and it's really useful, thanks!). Here's an example of erroneous behavior:
>>> from pybtex.database import Person
>>> Person('Brand\~ao, F')
Person(u'Brand\\ ao, F')
I'm proposing a patch which fixes this (attached).
Comments (2)
-
-
- changed status to resolved
fb456fb: Fix corner cases in detecting von names - this should make Pybtex behave exactly like BibTeX.
- Log in to comment
Turns out it's more complicated than that. :)
BibTeX does split the name at
\~
and counts both parts of'Brand\~{a}o'
as last names:Then it joins them back again with
~
when outputting the .bbl file, so the output looks OK.Pybtex currently thinks that
'Brand\'
is a von name: