Skip to content

quarto treats tables from kableExtra (tabu) as subtables #1486

@lbelzile

Description

@lbelzile

Bug description

Long tables generated by kableExtra are created using the tabu environment (rather than tabular) and the captions are incorrect (the LaTeX code generated includes a subcaption and the caption from the YAML tbl-cap instruction is missing.

---
title: "MWE"
format: pdf
keep-tex: true
---

```{r}
#| label: tbl-test1
#| echo: false
#| tbl-cap: "Table caption"
data("mtcars")
knitr::kable(mtcars[1:5,],
             row.names = FALSE)
```

```{r}
#| label: tbl-test2
#| echo: false
#| tbl-cap: "Table caption"
knitr::kable(mtcars[1:5,],
             row.names = FALSE) |>
  kableExtra::kable_styling(full_width = TRUE)
```

```{r}
#| label: tbl-test3
#| echo: false
#| tbl-cap: "Table caption"
data("mtcars")
kableExtra::kbl(mtcars[1:5,],
             row.names = FALSE)
```

quarto check Output

[✓] Checking Quarto installation......OK
      Version: 1.0.35
      Path: /opt/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.5
      Path: /usr/bin/python3
      Jupyter: 4.11.1
      Kernels: python3, julia-1.6, sagemath

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.1
      Path: /usr/lib64/R
      LibPaths:
        - /home/lbelzile/R/x86_64-pc-linux-gnu-library/4.2
        - /usr/lib/R/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK

quarto tools check Output


Tool         Status            Installed     Latest  
chromium     Not installed     ---           869685  
tinytex      Not installed     ---           v2022.07

I have tinytex version 0.40 installed. chromium is also installed on my computer.

tinytex::tlmgr_version()
tlmgr revision 63068 (2022-04-18 07:58:07 +0200)
TeX Live (https://tug.org/texlive) version 2022

Running Arch Linux

RStudio 2022.07.0+548 "Spotted Wakerobin" Release (34ea3031089fa4e38738a9256d6fa6d70629c822, 2022-07-06) for Ubuntu Bionic
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

Checklist

  • formatted your issue so it is easier for us to read?
  • included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • documented the quarto version you're running, by pasting the output from running quarto check in the "Quarto Check Output" text area?
  • documented the version of the quarto tools you're running, by providing the output from running quarto tools check in the "Quarto Tools Check Output" text area?
  • documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • documented which operating system you're running? If on Linux, please provide the specific distribution as well.
  • upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions