Closed bishun945 closed 2 years ago
Dear Stefano,
I had an issue when using Tex to create an expression which only requires variables to be italic.
Tex
For instance, latex2exp::TeX("$a$ is a variable", italic = TRUE) would return all characters, including "is a variable", as italic.
latex2exp::TeX("$a$ is a variable", italic = TRUE)
My tricky solution is by using
latex2exp::TeX("$a$ is a variable", output = "character") %>% gsub("'a'", "italic(a)", .) %>% parse(text = .)
Is there any better solution to make only $a$ italic?
Regards, Shun
Hi all,
My bad. The solution is to use \\textit:
\\textit
latex2exp::TeX("$\\textit{a} is a variable$")
Dear Stefano,
I had an issue when using
Tex
to create an expression which only requires variables to be italic.For instance,
latex2exp::TeX("$a$ is a variable", italic = TRUE)
would return all characters, including "is a variable", as italic.My tricky solution is by using
Is there any better solution to make only $a$ italic?
Regards, Shun