Skip to content

Math formatting does not work in styled KableExtra tables #555

@meghanto

Description

@meghanto

I am using Quarto 0.9.180 with Pandoc 2.5

Here is a sample qmd file

---
title: "Test"
format: html
---

```{r}
data <- data.frame(X1 = c(1,2,3,4), 
                   X2 = c(5,6,7,8), 
                   X3 = c(9,10,11,12), 
                   Y = c('R', 'R','G', 'R'), 
                   stringsAsFactors = F)

colnames(data) <- c('$X_{1}$', '$X_{2}$', '$X_{3}$', '$Y$')

library(knitr)
library(kableExtra)

kable(data, row.names = TRUE) %>%
   kable_styling(bootstrap_options = "striped", full_width = F)

```

And here is the corresponding rmd file.

---
title: "Test"
output: html_document
---

```{r}
data <- data.frame(X1 = c(1,2,3,4), 
                   X2 = c(5,6,7,8), 
                   X3 = c(9,10,11,12), 
                   Y = c('R', 'R','G', 'R'), 
                   stringsAsFactors = F)

colnames(data) <- c('$X_{1}$', '$X_{2}$', '$X_{3}$', '$Y$')

library(knitr)
library(kableExtra)

kable(data, row.names = TRUE) %>%
   kable_styling(bootstrap_options = "striped", full_width = F)
```

The two html outputs are here.
The quarto output does not render the math.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingknitrmathany issue related to math support in specific formatstablesIssues with Tables including the gt integrationthird-partyIssues involving interaction with a third-party library

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions