0

I have a table that contains cells with latex commands. For instance, one column header reads "\textit{Quantity}."

When I call kable on the table with the following code, the latex command (i.e., "\textit{Quantity}") appears in my document:

knitr::kable(table, format="latex")

When I change the format to "markdown", then the latex command gets interpreted (i.e., Quantity shows up in italics):

knitr::kable(table, format="markdown")

Is there any way to keep format="latex" but get the results of format="markdown"? I.e., I want the latex commands to be interpreted.

Namenlos
  • 475
  • 5
  • 17

1 Answers1

0

Yes, it can. See the below example:

data2$Physics<-c('$\frac{7}{20}$')

Kable(data2$Physics)

Display the above inside kable , you will see latex equation displayed correctly.

doctshind s
  • 380
  • 3
  • 13