Italicise text in latex figure caption produced by knitr

a 夏天 提交于 2019-12-10 18:56:13

问题


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?


回答1:


Try:

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

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

@

No need for the $$



来源:https://stackoverflow.com/questions/20956049/italicise-text-in-latex-figure-caption-produced-by-knitr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!