在Rmarkdown中使用texreg时摆脱字幕 [英] get rid of captions when using texreg in Rmarkdown
本文介绍了在Rmarkdown中使用texreg时摆脱字幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何隐藏texreg表的标题?我正在使用Rmarkdown生成LaTeX文件.这是一个简单的示例:
How do you suppress captions for a texreg table? I'm using Rmarkdown to generate a LaTeX file. Here's a simple example:
```{r, echo=FALSE, message=FALSE, results="asis"}
library(texreg)
data <- data.frame(a=c(1,2,3,4), b=c(6,3,4,4))
texreg(lm(a~b, data=data), caption="", custom.note="", float.pos="h!")
```
我得到的表的底部有一个标题,上面写着表1".我如何摆脱它?谢谢.
The table I get has a caption on the bottom that says "Table 1:". How do I get rid of it? Thanks.
推荐答案
在可以包含LaTeX软件包的YAML部分中,添加标题软件包:
In the YAML section where LaTeX packages can be included, add the caption package:
header-includes:
- \usepackage{caption}
然后在RMarkdown文档正文的开头添加:
Then at the beginning of the RMarkdown document body add:
\captionsetup[table]{labelformat=empty}
这将删除所有表格的标题标签.
This removes the caption labels for all tables.
这篇关于在Rmarkdown中使用texreg时摆脱字幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文