In Quarto, I'm adding a longish header (add_header_above) to a kable that marks a narrow column.
The header column in question is the one on the right.
The desired header has an equation and I add
\n to break the header into three rows. However there appears to be a conflict between the mutate_all(linebreak) to wrap the text and the 'escape=F' required for the equation. Here's an example
library(dplyr)
library(knitr)
library(kableExtra)
d < data.frame(1:4,1:4,1:4,1:4,1:4)
d %>%
mutate_all(linebreak) %>%
kable(format='latex',linesep='',col.names=NULL, escape=F,
booktabs=T, align='rlclr') %>%
kable_styling('striped',font_size=7.5) %>%
add_header_above(c('Reaction\nnumber'=1,'Half-Reactions'=3,
'$\\\\Delta G^0(W)\n$(kcal/electron\nequivalent)'=1))
The above wraps the header but does not render the equation in the third header item. If I leave out mutate_all(linebreak) and add escape = F to the header, the equation renders but linebreak doesn't work. Now, I can leave the equation out of the header and add a second header with the equation using escape=F and it works ok but seems kludgy
`add_header_above(c(' '=1,' '=3,'$\\\\Delta G^0(W)$'=1),escape=F,line=F)`
I know this is pretty esoteric but has anyone encountered this?