Skip to content

Instantly share code, notes, and snippets.

@moritzpschwarz
Last active October 12, 2023 14:18
Show Gist options
  • Save moritzpschwarz/6bb6040a513ad6ccb1a874ae004e060e to your computer and use it in GitHub Desktop.
Save moritzpschwarz/6bb6040a513ad6ccb1a874ae004e060e to your computer and use it in GitHub Desktop.
kable(foo, format = "latex", booktabs = T, row.names = FALSE, linesep = "", escape = FALSE) %>%
kable_styling(latex_options = c("striped")) %>%
group_rows("$\\\\text{Group1}^a$", 1, 2, escape = FALSE) %>%
group_rows(paste0("Group2\\\\", footnote_marker_alphabet(1), sep = ""), 3, 4, escape = FALSE) %>%
# I don't think expression() is helpful, doesn't seem to get converted
# to latex
group_rows(expression("Group3"^a), 5, 6) %>%
group_rows("Group4\\\\textsuperscript{a}", 7, 8, escape = FALSE)
# To add Greek symbols
kable(foo) %>%
add_header_above(c(" " = 6, "$\\lambda$" = 4), escape = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment