Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Italicise text in latex figure caption produced by knitr

Tags:

r

knitr

I'm trying to to italicise some text in a figure caption created by knitr. I have the code below in a .Rnw file and I'm converting it to a .tex file using knitr:

<<plot_setosa, fig.cap="A plot of $\\textit{setosa}$">>=

plot(iris[iris$Species == "setosa",])

@

How can I italicise setosa in the figure caption?

like image 300
luciano Avatar asked Dec 25 '22 15:12

luciano


1 Answers

Try:

<<plot_setosa, fig.cap="A plot of \\textit{setosa}">>=

plot(iris[iris$Species == "setosa",])

@

No need for the $$

like image 56
Tyler Rinker Avatar answered Dec 28 '22 10:12

Tyler Rinker