stefano-meschiari / latex2exp

Use LaTeX in R graphics.
Other
185 stars 10 forks source link

The symbol of absolute value in TeX()? #18

Closed fountainer closed 2 years ago

fountainer commented 5 years ago

The code TeX("$\\hat{|\\rho|}$") gives the following error:

Original string:  $\hat{|\rho|}$ 
Parsed expression:  paste('','',hat(paste('|',rho|,,,)),'') 
Error in parse(text = str) : <text>:1:31: unexpected ','
1: paste('','',hat(paste('|',rho|,
goepp commented 5 years ago

I have the same problem and have found no work-around.

DSLituiev commented 4 years ago

For me following worked: TeX("$\\hat{ | \\rho |}$") -- add spaces around the pipe

stefano-meschiari commented 2 years ago

Sorry for the delay in answering to this issue.

This should correctly work in 0.9.0 (plot(TeX("$|\\hat{\\rho}|$")))