latex: Render to LaTeX methods for tangram cell objects

View source: R/render-latex.R

latexR Documentation

Render to LaTeX methods for tangram cell objects

Description

Each of these methods will render the cell object as a LaTeX fragment

Usage

latex(object, ...)

## Default S3 method:
latex(object, ...)

## S3 method for class 'cell'
latex(object, na.blank = TRUE, ...)

## S3 method for class 'cell_label'
latex(object, ...)

## S3 method for class 'logical'
latex(object, ...)

## S3 method for class 'cell_header'
latex(object, ...)

## S3 method for class 'cell_subheader'
latex(object, ...)

## S3 method for class 'tangram'
latex(object, fragment = TRUE, filename = NULL, append = FALSE, ...)

Arguments

object

object; the item to render to latex

...

additional arguments

na.blank

logical; Dispaly NAs as blanks.

fragment

logical; Is this a complete LaTeX document or just the table fragment

filename

character; filename to write LaTex into

append

logical; Should the write be an append operation or overwrite

Details

There are addition arguments possible to control the rendering, but due to some oddities between CRAN requirements and how R handles defaults (for full details see the source code) they are as follows

* cgroup.just character; The text of the column justification used in the table

* arraystretch numeric; The arraystretch parameter used for vertical spacing

* style character; can be null or "nejm" for different table styling

* rel_size numeric; a scaling to be applied to the entire table, e.g. rel_size=-2

* placement character; placement directive, defaults to "H"

Value

the LaTeX rendering

Examples

latex(cell_label("123"))
latex(hmisc_iqr(rnorm(20)))
latex(hmisc_fraction(45, 137))
tbl <- tangram(drug~bili, pbc, "tbl")
latex(tbl)

spgarbet/tg documentation built on Feb. 21, 2023, 3:35 a.m.