Georgi Boshnakov
2022-Apr-08 20:58 UTC
[Rd] tools:::cleanupLaTex fails to drop braces in names containing consecutive accented characters
tools:::cleanupLaTex() fails to drop braces in names containing consecutive
accented characters.
For example, Ib??ez ends up rendered as Ib?{?}ez. This is a problem for high
level functions, e.g. cite(). For example, after importing the following into a
bibentry object, say `tmp`:
@article{DiaLop2020ejor,
author = { Juan Esteban Diaz and Manuel L{\'o}pez-Ib{\'a}{\~n}ez
},
title = {Incorporating Decision-Maker's Preferences into the
Automatic
Configuration of Bi-Objective Optimisation Algorithms},
journal = {European Journal of Operational Research},
year = 2021,
volume = 289,
number = 3,
pages = {1209--1222},
doi = {10.1016/j.ejor.2020.07.059},
}
> cite("DiaLop2020ejor", tmp, textual = TRUE)
## Diaz and L?pez-Ib?{?}ez (2021)
Here is an example showing that it is not related to a specific accented
character:
> e1 <- "Manuel L{\\'o}pez-Ib{\\'a}{\\~n}ez"
> e2 <- "Manuel L{\\'o}pez-Ib{\\~n}{\\'a}ez"
> tools:::cleanupLatex(e1)
## [1] "Manuel L?pez-Ib?{?}ez"> tools:::cleanupLatex(e2)
[1] "Manuel L?pez-Ib?{?}ez"
This may be a problem in certain circumstances. I narrowed this down to
`deparseLatex()` but it is not clear to me if a change may be need there or in
parseLatex() which creates the object processed by deparseLatex. I have given
more specific details of mu understanding of the problem in my comment at
https://github.com/GeoBosh/Rdpack/issues/25#issuecomment-1093336599 regarding a
bug report for Rdpack.
Georgi Boshnakov