benjaminrich / table1

78 stars 26 forks source link

format latex table columns with kabelExtra? #109

Closed biocyberman closed 7 months ago

biocyberman commented 1 year ago

Hi I am trying to add some format a specific column with column_spec function of kabelExtra package. Documentation for t1kable says it outputs "A kabelExtra object.". Therefore I tried:

t1kable(table1_object, digits=3, align='lrrrrrr', format = 'latex', booktabs = TRUE) %>% 
  column_spec(7, strikeout = TRUE)

But I got this when compiling the Rmd document:

! LaTeX Error: Illegal character in array arg.

benjaminrich commented 8 months ago

Sorry for the delay. I can't reproduce this (it works for me). If you are using R markdown (which I assume), make sure to include the following in the YAML header:

tables: true
header-includes:
  - \usepackage{booktabs}
  - \usepackage[normalem]{ulem}