I would like to include some latex math equations in a gt table. This will then be knit to pdf and html outputs from a Rmarkdown file.
In the reprex below, you can see what I am trying to achieve using the kable package, but would like to use gt for consistency.
Can this be done?
Copy this code into a Rmarkdown file and knit to reproduce:
---
title: "reprex"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(gt)
library(knitr)
```
```{r data}
df <- data.frame(key = 1,
equation = c("$exp(1.6 - 3.327 \\times x^2)$"))
```
```{r gt}
gt(df)
```
```{r kableExtra}
kable(df, escape = FALSE)
```