grid.latex: Render LaTeX in R

View source: R/grid.R

grid.latexR Documentation

Render LaTeX in R

Description

Render LaTeX code in R graphics.

Usage

latexGrob(tex, x = 0.5, y = 0.5, default.units = "npc", just = "centre", 
          rot = 0, device = names(dev.cur()), name = NULL,
          preamble=getOption("dvir.preamble"),
          postamble=getOption("dvir.postamble"),
          engine=latexEngine, tinytex=FALSE, file=NULL,
          initFonts=getOption("dvir.initFonts"),
          quiet=TRUE) 
grid.latex(...)

Arguments

tex

A character value containing LaTeX code.

x, y

Numeric values or units specifying where to draw the output.

default.units

Units to use if x or y are numeric.

just

Justification of the output relative to the x/y location.

rot

Angle of rotation (degrees).

device

Character value describing the name of the device that the output is to be drawn on.

name

Character value giving name for the grob.

preamble,postamble

LaTeX code that is placed around tex before processing.

engine

The TeX engine that is used for processing the LaTeX code.

tinytex

Should dvir attempt to use tinytex to perform the processing?

file

The name of a file to read LaTeX code from. If tex is missing, this file is read.

initFonts

Whether to reset the font cache; set to FALSE to allow font caching across multiple calls.

quiet

Suppress TeX engine output?

...

Arguments passed to latexGrob.

Details

This function takes LaTeX code as input, processes the LaTeX code to produce a DVI file, reads the DVI file, and renders the result using grid.

The default engine is the latexEngine, which runs latex to generate DVI; an alternative is the luatexEngine, which runs dvilualatex to generate DVI.

Value

A "DVIgrob" object.

Author(s)

Paul Murrell

See Also

readDVI, grid.dvi

Examples

## Not run: 

grid.latex("$x - \\mu$")

## End(Not run)

pmur002/dvir documentation built on Sept. 2, 2022, 3:03 p.m.