5

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?

luciano
  • 13,158
  • 36
  • 90
  • 130

1 Answers1

11

Try:

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

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

@

No need for the $$

Tyler Rinker
  • 108,132
  • 65
  • 322
  • 519