blob: 2014072ade776f4fc76dc189ae3cbb1acd14516d [file] [log] [blame]
Hao Zhuc1f38412017-02-23 12:13:48 -05001.onLoad <- function(libname = find.package("kableExtra"), pkgname = "kableExtra") {
Hao Zhu65216052017-09-04 13:01:29 -04002 load_packages <- getOption("kableExtra.latex.load_packages", default = TRUE)
3 if (load_packages) {
4 usepackage_latex("booktabs")
5 usepackage_latex("longtable")
6 usepackage_latex("array")
7 usepackage_latex("multirow")
Hao Zhu65216052017-09-04 13:01:29 -04008 usepackage_latex("wrapfig")
9 usepackage_latex("float")
10 usepackage_latex("colortbl")
11 usepackage_latex("pdflscape")
12 usepackage_latex("tabu")
Hao Zhu23bde3a2018-03-28 16:00:55 -040013 usepackage_latex("threeparttable")
Hao Zhu23456762018-03-26 12:30:10 -040014 usepackage_latex("threeparttablex")
Hao Zhuef0c8302018-01-12 13:30:20 -050015 usepackage_latex("ulem", "normalem")
Hao Zhu248bbef2018-04-02 18:25:14 -040016 usepackage_latex("makecell")
Hao Zhuf1873a42019-01-07 15:57:01 -050017 usepackage_latex("xcolor")
Hao Zhu65216052017-09-04 13:01:29 -040018 }
Hao Zhuf3155122018-04-11 12:55:51 -040019 auto_format <- getOption("kableExtra.auto_format", default = TRUE)
20 if (auto_format) auto_set_format()
Hao Zhue5b9bff2018-05-20 17:40:03 -040021 if (!is.null(rmarkdown::metadata$output) &&
22 rmarkdown::metadata$output %in% c(
23 "ioslides_presentation", "slidy_presentation"
24 )) {
25 options(kableExtra.html.bsTable = TRUE)
26 }
Hao Zhuc1450882018-10-03 17:56:26 -040027 if (!is.null(knitr::opts_knit$get("rmarkdown.pandoc.to")) &&
28 knitr::opts_knit$get("rmarkdown.pandoc.to") %in% c("epub3", "epub")) {
29 options(kableExtra.knit_print.dependency = FALSE)
30 }
Hao Zhuc1f38412017-02-23 12:13:48 -050031}