Skip to content

Duplicated Table labels in hmtl_document2 #1489

@herryATcsiro

Description

@herryATcsiro

Hi there,
I have a similar issue to #1223, but this is now for html_document2 and only table captions. Below example produces

Image

Code:

--- title: "Untitled" output: bookdown::html_document2: number_sections: true global_numbering: true editor_options: chunk_output_type: console date: "2025-02-05" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) require(kableExtra) require(bookdown) ``` ## R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: ```{r cars, echo=F, warnings=F, error=F, message=F, results="asis", include=T, tidy=F} summary(cars)%>% kable(longtable=F, booktabs=T, caption="test table label")%>% kableExtra::kable_classic(full_width=F, html_font='Cambria', position="left") ``` ## Including Plots You can also embed plots, for example: ```{r pressure, echo=FALSE, fig.cap="Figure caption label"} plot(pressure) ``` 

This is on R version 4.4.2 (2024-10-31) -- "Pile of Leaves", ubuntu,
RStudio 2024.12.0+467 "Kousa Dogwood" Release (cf37a3e5488c937207f992226d255be71f5e3f41, 2024-12-11) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2024.12.0+467 Chrome/126.0.6478.234 Electron/31.7.6 Safari/537.36, Quarto 1.5.57
Bookdown: 0.42,
rmarkdown::pandoc_version(): [1] ‘3.2’

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorexternal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions