knit_print.formula: Generate LaTeX math from an R formula

View source: R/knit_print.formula.R

knit_print.formulaR Documentation

Generate LaTeX math from an R formula

Description

Generate LaTeX math from an R formula

Usage

## S3 method for class 'formula'
knit_print(x, inline = TRUE, replacements = list(), ..., width = 80)

Arguments

x

A formula

inline

Should the formula be generated for use inline or as a separate line? (In LaTeX notation, with "$" or "$$".)

replacements

A named list where whenever the list name is seen as the text for any complete part of the equation, it is replaced with the value (which should be a LaTeX equation fragment).

...

Currently ignored

width

Approximate number of characters for splitting to multiple lines. (Not yet implemented.)

Value

A knitr asis_output() formula

Examples

knit_print(a~b)
# The same with an equal sign
knit_print(a~b, replacements=list("\\sim"="="))
knit_print(a~b/c)

billdenney/bsd.report documentation built on Jan. 16, 2024, 12:54 a.m.