TeX("$\\alpha$") # plots the greek alpha character
TeX("The ratio of 1 and 2 is $\\frac{1}{2}$")
a <- 1:100
plot(a, a^2, xlab=TeX("$\\alpha$"), ylab=TeX("$\\alpha^2$"))
# create a \variance command that takes a single argument
TeX("$\\variance{X} = 10$", user_defined=list("\\variance"="sigma[$arg1]^2"))
Run the code above in your browser using DataLab