Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "\left(" with "\right." - bgroup is not correctly constructed #24

Closed
kathsel opened this issue Jan 13, 2020 · 1 comment
Closed

Comments

@kathsel
Copy link

kathsel commented Jan 13, 2020

In LaTeX one can construct a large open parenthesis with \left(\frac{M}{L}\right.. Using this with TeX is possible and gives:

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 ".").

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

grafik

@stefano-meschiari
Copy link
Owner

This bug is now fixed in the latest release (v0.9.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants