Closed kathsel closed 2 years ago
In LaTeX one can construct a large open parenthesis with \left(\frac{M}{L}\right.. Using this with TeX is possible and gives:
\left(\frac{M}{L}\right.
TeX
TeX("$\\left(\\frac{M}{L}\\right.$") #> expression(`$\left(\frac{M}{L}\right.$` = #> paste("", "", bgroup("(", paste("", frac(paste("M"), paste("", "L")), ""))))
It is not possible to use this as the bgroup is missing the "closing" dot. The correct code would be: expression(bgroup("(", frac("M", "L"), ".")) (I removed unneccessary paste and empty strings, for emphasis on the ".").
bgroup
expression(bgroup("(", frac("M", "L"), "."))
paste
"."
plot.new() plot.window(c(0,3), c(0,1)) text(0, 0.5, latex2exp::TeX("$\\left(\\frac{M}{L}\\right)$")) # works text(1, 0.5, latex2exp::TeX("$\\left(\\frac{M}{L}\\right.$"))
Error in bgroup("(", paste("", frac(paste("M"), paste("", "L")), "")) : invalid group specification text(2, 0.5, expression(bgroup("(", frac("M", "L"), "."))) # works
Error in bgroup("(", paste("", frac(paste("M"), paste("", "L")), "")) : invalid group specification
text(2, 0.5, expression(bgroup("(", frac("M", "L"), "."))) # works
This bug is now fixed in the latest release (v0.9.0).
In LaTeX one can construct a large open parenthesis with
\left(\frac{M}{L}\right.
. Using this withTeX
is possible and gives:It is not possible to use this as the
bgroup
is missing the "closing" dot. The correct code would be:expression(bgroup("(", frac("M", "L"), "."))
(I removed unneccessarypaste
and empty strings, for emphasis on the"."
).