Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Knit to pdf doesn't work when using Kable

I'm using rmarkdown in rstudio and want to knit to pdf. This works well, except for when I use kable. I'm using the following yaml and it used to work in the past, but now I had to reinstall R, Rstudio and MacTex and now it doesn't work anymore.

---
title: "example"
output:
  pdf_document:
    df_print: kable
    latex_engine: xelatex
---

```{r}
cars
```

The error message I get is:

output file: example.knit.md

! LaTeX Error: Environment kable-table undefined.

Error: LaTeX failed to compile example.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Study-1.log for more info.

Does anyone know how to solve this?

like image 775
Laurens Avatar asked Jan 29 '26 20:01

Laurens


1 Answers

This is a bug of rmarkdown (against higher versions of Pandoc), which I just fixed on Github. Please try:

remotes::install_github('rstudio/rmarkdown')
like image 153
Yihui Xie Avatar answered Jan 31 '26 23:01

Yihui Xie