forked from rstudio/rmarkdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontext_document.Rd
129 lines (107 loc) · 4.76 KB
/
context_document.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/context_document.R
\name{context_document}
\alias{context_document}
\title{Convert to a ConTeXt document}
\usage{
context_document(
toc = FALSE,
toc_depth = 2,
number_sections = FALSE,
fig_width = 6.5,
fig_height = 4.5,
fig_crop = "auto",
fig_caption = TRUE,
dev = "pdf",
df_print = "default",
template = NULL,
keep_tex = FALSE,
keep_md = FALSE,
citation_package = c("default", "natbib", "biblatex"),
includes = NULL,
md_extensions = NULL,
output_extensions = NULL,
pandoc_args = NULL,
context_path = NULL,
context_args = NULL,
ext = c(".pdf", ".tex")
)
}
\arguments{
\item{toc}{\code{TRUE} to include a table of contents in the output}
\item{toc_depth}{Depth of headers to include in table of contents}
\item{number_sections}{\code{TRUE} to number section headings}
\item{fig_width}{Default width (in inches) for figures}
\item{fig_height}{Default height (in inches) for figures}
\item{fig_crop}{Whether to crop PDF figures with the command
\command{pdfcrop}. This requires the tools \command{pdfcrop} and
\command{ghostscript} to be installed. By default, \code{fig_crop = TRUE}
if these two tools are available.}
\item{fig_caption}{\code{TRUE} to render figures with captions}
\item{dev}{Graphics device to use for figure output (defaults to pdf)}
\item{df_print}{Method to be used for printing data frames. Valid values
include "default", "kable", "tibble", and "paged". The "default" method
uses a corresponding S3 method of \code{print}, typically
\code{print.data.frame}. The "kable" method uses the
\code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses
the \pkg{tibble} package to print a summary of the data frame. The "paged"
method creates a paginated HTML table (note that this method is only valid
for formats that produce HTML). In addition to the named methods you can
also pass an arbitrary function to be used for printing data frames. You
can disable the \code{df_print} behavior entirely by setting the option
\code{rmarkdown.df_print} to \code{FALSE}. See
\href{https://bookdown.org/yihui/rmarkdown/html-document.html#data-frame-printing}{Data
frame printing section} in bookdown book for examples.}
\item{template}{Pandoc template to use for rendering. Pass "default" to use
the rmarkdown package default template; pass \code{NULL} to use pandoc's
built-in template; pass a path to use a custom template that you've
created. See the documentation on
\href{https://pandoc.org/MANUAL.html}{pandoc online documentation} for
details on creating custom templates.}
\item{keep_tex}{Keep the intermediate tex file used in the conversion to PDF}
\item{keep_md}{Keep the markdown file generated by knitting.}
\item{citation_package}{The LaTeX package to process citations, \code{natbib}
or \code{biblatex}. Use \code{default} if neither package is to be used,
which means citations will be processed via the command
\command{pandoc-citeproc}.}
\item{includes}{Named list of additional content to include within the
document (typically created using the \code{\link{includes}} function).}
\item{md_extensions}{Markdown extensions to be added or removed from the
default definition or R Markdown. See the \code{\link{rmarkdown_format}} for
additional details.}
\item{output_extensions}{Pandoc extensions to be added or removed from the
output format, e.g., \code{"-smart"} means the output format will be
\code{latex-smart}.}
\item{pandoc_args}{Additional command line options to pass to pandoc}
\item{context_path}{Path of the ConTeXt executable. If not provided, ConTeXt has
to be available from the \code{PATH} environment variable.}
\item{context_args}{Command line arguments passed to ConTeXt.}
\item{ext}{Format of the output document (defaults to ".pdf").}
}
\value{
R Markdown output format to pass to \code{\link{render}}.
}
\description{
Format for converting from R Markdown to PDF using
\href{https://wiki.contextgarden.net/Main_Page}{ConTeXt}.
}
\details{
ConTeXt needs to be installed. To install the most recent version, see
\url{https://wiki.contextgarden.net/Installation}. A less recent version is
also available in TeX Live, you can install it with
\code{tinytex::tlmgr_install("context")}.
R Markdown documents can have optional metadata that is used to generate a
document header that includes the title, author, and date. For more details
see the documentation on R Markdown \link[=rmd_metadata]{metadata}.
R Markdown documents also support citations. You can find more information on
the markdown syntax for citations in the
\href{https://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html}{Bibliographies
and Citations} article in the online documentation.
}
\examples{
\dontrun{
library(rmarkdown)
# simple invocation
render("input.Rmd", context_document())
}
}