Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
| 2 | % Please edit documentation in R/cell_spec.R |
| 3 | \name{cell_spec} |
| 4 | \alias{cell_spec} |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 5 | \alias{text_spec} |
| 6 | \title{Specify Cell/Text format} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 7 | \usage{ |
Hao Zhu | 6f362bb | 2017-10-23 23:21:38 -0400 | [diff] [blame] | 8 | cell_spec(x, format, bold = FALSE, italic = FALSE, monospace = FALSE, |
| 9 | color = NULL, background = NULL, align = NULL, font_size = NULL, |
| 10 | angle = NULL, tooltip = NULL, popover = NULL, link = NULL, |
| 11 | escape = TRUE, background_as_tile = TRUE, |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 12 | latex_background_in_cell = TRUE) |
| 13 | |
Hao Zhu | 6f362bb | 2017-10-23 23:21:38 -0400 | [diff] [blame] | 14 | text_spec(x, format, bold = FALSE, italic = FALSE, monospace = FALSE, |
| 15 | color = NULL, background = NULL, align = NULL, font_size = NULL, |
| 16 | angle = NULL, tooltip = NULL, popover = NULL, link = NULL, |
| 17 | escape = TRUE, background_as_tile = TRUE, |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 18 | latex_background_in_cell = FALSE) |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 19 | } |
| 20 | \arguments{ |
| 21 | \item{x}{Things to be formated. It could be a vector of numbers or strings.} |
| 22 | |
| 23 | \item{format}{Either "html" or "latex". It can also be set through |
| 24 | \code{option(knitr.table.format)}, same as \code{knitr::kable()}.} |
| 25 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 26 | \item{bold}{T/F for font bold.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 27 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 28 | \item{italic}{T/F for font italic.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 29 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 30 | \item{monospace}{T/F for font monospaced (verbatim)} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 31 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 32 | \item{color}{A character string for text color. Here please pay |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 33 | attention to the differences in color codes between HTML and LaTeX.} |
| 34 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 35 | \item{background}{A character string for background color. Here please |
| 36 | pay attention to the differences in color codes between HTML and LaTeX. Also |
| 37 | note that in HTML, background defined in cell_spec won't cover the whole |
| 38 | cell.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 39 | |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 40 | \item{align}{A character string for cell alignment. For HTML, possible |
| 41 | values could be \code{l}, \code{c}, \code{r} plus \code{left}, \code{center}, \code{right}, \code{justify}, |
| 42 | \code{initial} and \code{inherit} while for LaTeX, you can only choose |
| 43 | from \code{l}, \code{c} & \code{r}.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 44 | |
Hao Zhu | 6f362bb | 2017-10-23 23:21:38 -0400 | [diff] [blame] | 45 | \item{font_size}{A numeric input for font size. For HTML, you can also use |
| 46 | options} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 47 | |
Hao Zhu | 9ce317e | 2017-10-12 18:19:55 -0400 | [diff] [blame] | 48 | \item{angle}{0-360, degree that the text will rotate. Can be a vector.} |
| 49 | |
Hao Zhu | 064990d | 2017-10-17 18:08:42 -0400 | [diff] [blame] | 50 | \item{tooltip}{A vector of strings to be displayed as tooltip. |
Hao Zhu | 6f362bb | 2017-10-23 23:21:38 -0400 | [diff] [blame] | 51 | Obviously, this feature is only available in HTML. Read the package |
| 52 | vignette to see how to use bootstrap tooltip css to improve the loading |
| 53 | speed and look.} |
| 54 | |
| 55 | \item{popover}{Similar with tooltip but can hold more contents. The best way |
| 56 | to build a popover is through \code{spec_popover()}. If you only provide a text |
| 57 | string, it will be used as content. Note that You have to enable this |
| 58 | bootstrap module manually. Read the package vignette to see how.} |
| 59 | |
| 60 | \item{link}{A vector of strings for url links. Can be used together with |
| 61 | tooltip and popover.} |
| 62 | |
| 63 | \item{escape}{T/F value showing whether special characters should be escaped.} |
Hao Zhu | 457acb4 | 2017-10-14 17:37:02 -0400 | [diff] [blame] | 64 | |
| 65 | \item{background_as_tile}{T/F value indicating if you want to have round |
Hao Zhu | ce5ee41 | 2017-10-23 01:14:38 -0400 | [diff] [blame] | 66 | cornered tile as background in HTML.} |
| 67 | |
| 68 | \item{latex_background_in_cell}{T/F value. It only takes effect in LaTeX |
| 69 | when \code{background} provided, Default value is \code{TRUE}. If it's \code{TRUE}, the |
| 70 | background only works in a table cell. If it's \code{FALSE}, it works outside of a |
| 71 | table environment.} |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 72 | } |
| 73 | \description{ |
| 74 | Specify Cell format before it gets into kable |
| 75 | } |