stefano-meschiari / latex2exp

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

horizontal spacing didn't work (for me) #19

Closed rcorty closed 2 years ago

rcorty commented 5 years ago

not sure if i was doing it right, but I couldn't get whitespace with

$\;$ nor $\,$

Would be great to support, e.g. \hspace{2cm} as well

rcorty commented 5 years ago

The line from my ggplot was

    xlab(TeX(paste('lower $V_e \;$'strain')))
billy34 commented 4 years ago

You have to escape twice \\; instead of \; as it's an R string

xlab(TeX(paste('lower $V_e \\;$'strain')))
stefano-meschiari commented 2 years ago

Sorry for the delay in answering this issue. As @billy34 mentioned, you need to escape the backslash (\\;) or use the new R raw string syntax, which would look like

TeX(r'(lower $V_e \;$'strain)')