Get rid of captions when using texreg in Rmarkdown

How do you suppress captions for texreg table? I am using Rmarkdown to create a LaTeX file. Here is 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!")
```

In the table that I get, there is an inscription below that reads "Table 1:". How can I get rid of it? Thank.

+2
source share
2 answers

In the YAML section, which can include LaTeX packages, add a subtitle package:

header-includes:
    - \usepackage{caption}

Then at the beginning of the body of the RMarkdown document add:

\captionsetup[table]{labelformat=empty}

This removes label labels for all tables.

+2
source

.tex (.. , ), \usepackage{caption} ( ) .tex , yaml RMarkdown.

0

All Articles