as_latex()
converts an R Object (currently Tatoo_table
s and
data.frame
s) to latex code.
save_pdf()
is a wrapper around as_latex()
for directly saving
an R object to .pdf
.
view_pdf()
is another wrapper for directly viewing an R
Object's pdf representation on a pdf viewer (powered by open_file()
).
as_latex(x, ..., kable_options = default_kable_options())save_pdf(
x,
outfile,
...,
overwrite = FALSE,
papersize = "a4paper",
orientation = "portrait",
keep_source = FALSE,
template = system.file("templates", "save_tex.Rmd", package = "tatoo")
)
view_pdf(x, ...)
as_latex()
returns a character
scalar of Latex code
save_pdf()
returns a the path to the saved file as character
scalar.
view_pdf()
returns NULL
(invisibly)
a Tatoo_table
, data.frame
or a list of data.frame
s
passed on to methods
list
. Options passed on to knitr::kable()
. See
default_kable_options()
for details.
character
scalar. Path to the output file
If TRUE
, overwrite any existing file.
character
scalar. Passed on to the latex command
\\geometry
from the 'geometry' package. Valid values are: a0paper, a1paper, a2paper, a3paper, a4paper, a5paper, a6paper, b0paper, b1paper, b2paper, b3paper, b4paper, b5paper, b6paper, c0paper, c1paper, c2paper, c3paper, c4paper, c5paper, c6paper, b0j, b1j, b2j, b3j, b4j, b5j, b6j, ansiapaper, ansibpaper, ansicpaper, ansidpaper, ansiepaper, letterpaper, executivepaper, legalpaper
character
scalar. Passed on to the latex command
\\geometry
from the 'geometry' package. Valid values are:
portrait
, landscape
When saving a pdf
, also put the Latex source
in the same directory.
Latex template for the desired output. Use the template file supplied in this package if you want to create your own.
as_latex
requires that the following Latex packages are installed on your
system:
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{threeparttablex}
as_latex()
and co. are designed to produce nice looking output with a
minimum of user input required. This is useful if you want a quick preview or
printout of a table. If you need customized Latex the output, you should
take a look at the packages kableExtra::kableExtra, xtable, or
huxtable.
Other as_latex methods:
as_latex.Composite_table()
,
as_latex.Mashed_table()
,
as_latex.Tagged_table()
,
as_latex.Tatoo_report()
,
as_latex.data.frame()
as_latex(iris)
if (FALSE) {
view_pdf(iris) # Not supported on all systems
}
Run the code above in your browser using DataLab