r - knitr 生产的 latex 图标题中的斜体文本

标签 r knitr

我正在尝试将 knitr 创建的图形标题中的一些文本设为斜体。我在 .Rnw 文件中有下面的代码,我正在使用 knitr 将其转换为 .tex 文件:

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

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

@

如何在图形标题中将 setosa 斜体?

最佳答案

尝试:

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

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

@

不需要 $$

关于r - knitr 生产的 latex 图标题中的斜体文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20956049/

相关文章:

r - 如何找到下一步要去的地方

基于向量 new_varname、old_varname 重命名 dplyr 中的变量名称

r - f(init, x[[i]]) 中的错误 : unused argument (x[[i]])

r - 如何按 R 中的自定义规则对字符串列表进行排序?

r - 在书本结尾处创建定义/定理的索引

r - 在 "for"循环中绘制几张不同大小的图片

r - 安装 Anaconda 后无法安装 R 包

r - 在Rstudio中将Slidify与Knitr和R Markdown结合使用时出错

wordpress - 从 R+knitr 发布到 WordPress?

latex - 在 R Markdown 中渲染 Angstrom