Closed mariusbarth closed 2 years ago
Could you check if PR #42 fixes this issue?
You can install it via
devtools::install_github("stefano-meschiari/latex2exp", ref="0.9.2")
Of course! I think this is good:
> str(TeX(" "))
Classes 'latexexpression', 'expression' length 1 expression(" ")
..- attr(*, "latex")= chr " "
..- attr(*, "plotmath")= chr "' '"
> str(TeX(""))
Classes 'latexexpression', 'expression' length 1 expression("")
..- attr(*, "latex")= chr ""
..- attr(*, "plotmath")= chr ""
Thanks a lot!
No problem, thank you so much for the report and your kind words.
I will submit a new version to CRAN over the next few days.
Hi @stefano-meschiari,
Thank you very much for this awesome package! After installing v0.9.0, I ran into problems with my own functions that build on
TeX()
. I could pin down the problem easily, but I think it might be worth discussing whether or not something should be changed in latex2exp, too.Here is the issue: If an empty character is passed (i.e.,
TeX("")
), the new return value in version 0.9.0 has length zero, while in earlier versions it was an empty expression (i.e., the same as fromexpression("")
). I believe the old behaviour is preferable (and "right") because it makes the output more predictable andlength("")
equals 1 in R.What do you think?
Best regards, Marius