Quantcast
Channel: Active questions tagged kable - Stack Overflow
Viewing all articles
Browse latest Browse all 105

Losing math type when using kableExtra styling

$
0
0

I would like to use kable() and some of the functions in the kableExtra package to display a table that includes different math type (table of laboratory values with different metrics) in a pdf report. However, if I'm using some of the functions in the kableExtra package, the math styling is lost. For example:

library(knitr)library(kableExtra)k <- mtcars[c(1:5), c(1:5)]k[3,3] <- '$\\mu$mm$^3$'kable(k, escape = TRUE)

Works as expected:

math type works

But if I add in some extra styling, such as add_indent, the math symbols are no longer preserved.

kable(k, escape = TRUE) %>%  add_indent(3)

EDIT: I've tried both with escape=TRUE and escape=FALSE, and neither produces the desired output.

Results in:

math type does not work

Any help is appreciated. Thanks!


Viewing all articles
Browse latest Browse all 105

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>