r - 如何控制 KnitR 中人物的标题位置?

标签 r latex knitr

有没有办法为 R 使用 KnitR 生成的图形指定标题的位置?我希望有一些功能等同于 xtable()caption.placement选项。

下面提供了一个最小的工作示例。

\documentclass[12pt, english, oneside]{amsart}
\begin{document}

The caption for Figure \ref{fig:plot} is placed below the figure. Could we place it above, instead?
<<plot, echo=FALSE, fig.cap="Default caption placement is below the figure.">>=
plot(x=0, y=0)
@

\end{document}

最佳答案

对于所有人物,这可能最好以 latex 样式处理,但您可以使用钩子(Hook)自定义人物。 fig.env chunk 选项控制 block 插入的环境。您可以随时制作自己的 figure 版本使用您自己的格式。

关于r - 如何控制 KnitR 中人物的标题位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15030517/

相关文章:

r - 有没有办法在 tidyverse 生态系统中使用循环?

latex - 在 LaTeX 中创建多项选择题

r - 从 knitr 中的子文档中剥离 YAML

r - 为 df 创建组索引

R:如何预分配空数据帧列表?

python - R 和 python 中的 h2o 包

r - 使用 Brew、Pander 和 R 自动化 LaTeX 报告

latex - 如何将 asciimath 转换为 latex

r - 在R markdown pdf文档的右上角插入一个logo

knitr:在 fig.cap block 选项中使用内联表达式