rstudio / gt

Easily generate information-rich, publication-quality tables from R
https://gt.rstudio.com
Other
2.01k stars 205 forks source link

Special characters in table #645

Closed embiuw closed 3 years ago

embiuw commented 4 years ago

Hi gt team, Thanks for a fantastic package! One question/request. Is it possible to include math symbols in a gt table in an Rmd file when rendering to pdf via latex? Example below where variable names should be as math symbols.

Thanks! Martin

df <- data.frame(x=rnorm(3), y=rnorm(3))
names(df) <- c("$\\hat{P_a}$", "se($\\hat{P_a}$)")
gt(df)
embiuw commented 3 years ago

Thanks @coatless for the link to the existing thread!