blob: a82634c408393233a08d36f749912cfd299dca36 [file] [log] [blame]
Hao Zhu4f8eaa22018-01-11 16:14:25 -05001---
2title: "Legacy or Unrecommended Features"
3author: "Hao Zhu"
4date: "`r Sys.Date()`"
5output:
6 html_document:
7 theme: simplex
8vignette: >
9 %\VignetteIndexEntry{Legacy or Unrecommended Features}
10 %\VignetteEngine{knitr::rmarkdown}
11 %\VignetteEncoding{UTF-8}
12---
13
14This document includes documentations for legacy/unrecommended features in this package.
15
16Unless there are significant differences between HTML/LaTeX, I will only keep one copy of documentation in HTML here since most of the functions in this packages share a very similar interface between their HTML and LaTeX ends.
17
18```{r, warning=FALSE}
19library(knitr)
20library(kableExtra)
21dt <- mtcars[1:5, 1:6]
22```
23
24# Unrecommended Features
25
26## add_footnote
27As the first function written in this package, the design of the `add_footnote` function is not flexible enough to introduce new features to this function. So I redesigned the footnote part and created the `footnote()` function. `add_footnote` will still be there for a while and be maintained because of its unique feature to add page footnote to longtables.
28
29Here are the old documentation for `add_footnote`.
30
31### Notation systems
32You can also use `add_footnote()` function from this package. You will need to supply a character vector with each element as one footnote. You may select from `number`, `alphabet` and `symbol` for different types of notations. Example are listed below.
33
34#### Alphabet
35```{r}
36kable(dt, "html") %>%
37 kable_styling("striped") %>%
38 add_footnote(c("Footnote 1", "Have a good day."), notation = "alphabet")
39```
40
41#### Number
42```{r}
43kable(dt, "html") %>%
44 kable_styling("striped") %>%
45 add_footnote(c("Footnote 1", "Have a good day."), notation = "number")
46```
47
48#### Symbol
49```{r}
50kable(dt, "html") %>%
51 kable_styling("striped") %>%
52 add_footnote(c("Footnote 1", "Footnote 2", "Footnote 3"), notation = "symbol")
53```
54
55### In-table markers
56By design, `add_footnote()` will transform any `[note]` to in-table footnote markers.
57
58```{r}
59kable(dt, "html", caption = "Demo Table[note]") %>%
60 kable_styling("striped") %>%
61 add_header_above(c(" ", "Group 1[note]" = 3, "Group 2[note]" = 3)) %>%
62 add_footnote(c("This table is from mtcars",
63 "Group 1 contains mpg, cyl and disp",
64 "Group 2 contains hp, drat and wt"),
65 notation = "symbol")
66```