Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 1 | .onLoad <- function(libname = find.package("kableExtra"), pkgname = "kableExtra") { |
Hao Zhu | 6521605 | 2017-09-04 13:01:29 -0400 | [diff] [blame] | 2 | 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 Zhu | 6521605 | 2017-09-04 13:01:29 -0400 | [diff] [blame] | 8 | usepackage_latex("wrapfig") |
| 9 | usepackage_latex("float") |
| 10 | usepackage_latex("colortbl") |
| 11 | usepackage_latex("pdflscape") |
| 12 | usepackage_latex("tabu") |
Hao Zhu | 23bde3a | 2018-03-28 16:00:55 -0400 | [diff] [blame] | 13 | usepackage_latex("threeparttable") |
Hao Zhu | 2345676 | 2018-03-26 12:30:10 -0400 | [diff] [blame] | 14 | usepackage_latex("threeparttablex") |
Hao Zhu | ef0c830 | 2018-01-12 13:30:20 -0500 | [diff] [blame] | 15 | usepackage_latex("ulem", "normalem") |
Hao Zhu | 248bbef | 2018-04-02 18:25:14 -0400 | [diff] [blame] | 16 | usepackage_latex("makecell") |
Hao Zhu | 6521605 | 2017-09-04 13:01:29 -0400 | [diff] [blame] | 17 | } |
Hao Zhu | f315512 | 2018-04-11 12:55:51 -0400 | [diff] [blame] | 18 | auto_format <- getOption("kableExtra.auto_format", default = TRUE) |
| 19 | if (auto_format) auto_set_format() |
Hao Zhu | e5b9bff | 2018-05-20 17:40:03 -0400 | [diff] [blame] | 20 | if (!is.null(rmarkdown::metadata$output) && |
| 21 | rmarkdown::metadata$output %in% c( |
| 22 | "ioslides_presentation", "slidy_presentation" |
| 23 | )) { |
| 24 | options(kableExtra.html.bsTable = TRUE) |
| 25 | } |
Hao Zhu | c145088 | 2018-10-03 17:56:26 -0400 | [diff] [blame] | 26 | if (!is.null(knitr::opts_knit$get("rmarkdown.pandoc.to")) && |
| 27 | knitr::opts_knit$get("rmarkdown.pandoc.to") %in% c("epub3", "epub")) { |
| 28 | options(kableExtra.knit_print.dependency = FALSE) |
| 29 | } |
Hao Zhu | c1f3841 | 2017-02-23 12:13:48 -0500 | [diff] [blame] | 30 | } |