-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add phantom #22
Add phantom #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, does this add the \phantom command ?
I tried from the wzel github package, however the \phantom{whatever} is mapped a string not as a latex command.
It would be great to have this functionality as this would allow parsing parts of a math expression under phantom (other parts, not) and, using several annotations, have a colourized annotation on ggplot2.
Hi, I just checked, and it works for me in annotations: library(ggplot2)
library(latex2exp)
ggplot(data.frame(x = 1:2, y = 1:2),
aes(x = x, y = y)) +
geom_point() +
annotate("text",
x = 1.5, y = 1.5,
label = TeX("a\\phantom{b}c"),
parse = TRUE) |
Glad that you find this useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Sorry for the delay in checking out and merging this PR — I'm just now catching up and implementing some of the improvements I had in the backlog.
# latex2exp 0.5.0 * Update Documentation to use the new raw strings introduced in R 4.0 (which lets one do away with the quoting of the backslash character; e.g. one can use `TeX(r'($\alpha^\beta$)')` rather than `TeX('\\alpha^\\beta)`) * Adds parameters `bold` and `italic` to `TeX()`. These can be used to make the entire expression bold or italic. * Adds `\phantom{}` ([PR](stefano-meschiari/latex2exp#22))
Add \phantom{} support.