Don't include chunk name in table name in Rmarkdown

58 views Asked by At

I have a problem with Rmarkdown and writing tables to html. I'm writing tables with kableextra and the table name comes out like this in the html output: (#tab:chunk name)table name. I only want my own table name I give to kable via caption= without the (#tab:chunk name).
I've already tried the suggestion from How to suppress automatic table name and number in an .Rmd file using xtable or knitr::kable? :

header-includes:
    - \usepackage[labelformat=empty]{caption} 

But it doesn't seem to work for html_document2, only for html_document. I'm using bookdown::html_document2 as output, because it is needed for some other things in the document, so I can't switch to html_document.

Any suggestions on how to fix this?

Thanks in advance!

0

There are 0 answers