N with tilde issues

Issue #116 resolved
Jerry James created an issue

Using pybtex version 0.21, this bibliography entry:

@article{Quinonero-Candela2005, author = {Qui\~{n}onero-Candela, J. and Rasmussen, C. E.}, title = {A Unifying View of Sparse Approximate Gaussian Process Regression}, journal = {Journal of Machine Learning Research}, volume = {6}, year = {2005}, pages = {1939--1959}, }

results in this error when invoked from sphinx-build:

Exception occurred: File "/usr/lib/python2.7/site-packages/latexcodec/lexer.py", line 395, in decode raise ValueError(e) ValueError: 'latex' codec can't decode byte 0x5c in position 3: unknown token u'\'

The error message does not indicate which bibliography file has the error, nor which line number the error occurred on, so it took me quite a while to figure out that this entry was the problem.

If I use pybtex.database.parse_file to parse the file containing this entry, I see (in part):

persons=OrderedCaseInsensitiveDict([(u'author', [Person(u'Qui\ {n}onero-Candela, J.'), Person(u'Rasmussen, C. E.')])])

Note that the tilde has disappeared. There is a space there instead. If I replace \~{n} with the corresponding Unicode character, all is well.

I do not know if this is a pybtex error or a latexcodec error, so trying here first in hopes somebody who knows the code can figure it out. This is with latexcodec 1.0.5.

Comments (2)

  1. Log in to comment