grid.tikz: Render a TikZ picture in R

View source: R/tikz.R

grid.tikzR Documentation

Render a TikZ picture in R

Description

Render a TikZ picture in R graphics.

Usage

tikzpictureGrob(tex, ...,
                bbox=NULL,
                preamble=tikzpicturePreamble(),
                postamble=tikzpicturePostamble(bbox),
                engine=TeXengine("latex", special=tikzSpecial))
grid.tikzpicture(...)
tikzGrob(tex, ...,
         preamble=tikzPreamble(),
         postamble=getOption("dvir.postamble"),
         engine=TeXengine("latex", special=tikzSpecial))
grid.tikz(...)

Arguments

tex

A character value containing LaTeX code.

bbox

A bounding box to enforce for the picture.

preamble,postamble

LaTeX code that is placed around tex before processing.

engine

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

...

Arguments passed to latexGrob.

Details

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

The default preamble loads the TikZ package and starts a TikZ picture environment (so tex only needs to contain TikZ code). The tikzPreamble function can be used create variations on that.

The default postamble closes the TikZ picture environment. If bbox has been specified, additional TikZ and PGF code is added to enforce the bounding box. The tikzPostamble function can be used to create variations on that.

The default engine is a LaTeX engine, with tikzSpecial as to handle the DVI specials that are generated from the TikZ code.

The grid.tikz function loads the TikZ package, but does not start a TikZ picture environment. This allows for a combination of normal LaTeX content along with a TikZ picture.

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.