tikzPackage: LaTeX Package tikz.

View source: R/tikz.R

tikz PackageR Documentation

LaTeX Package tikz.

Description

Define a LaTeXPackage for the LaTeX tikz package.

Usage

tikzPackage(name="tikz", packages=NULL, bbox=TRUE, quote=TRUE)
tikzPicture(name="tikzPicture", packages=NULL, bbox=TRUE, quote=TRUE)

Arguments

name

The name of the resulting package.

packages

A character list of TikZ package names.

bbox

Either a logical indicating whether to use (or ignore) the TikZ bounding box at the end of a TikZ picture, or a numeric vector of 4 values (left, bottom, right, top) describing the bounding box to use for the TikZ picture.

quote

Whether to place single quotes around the path to the pgfsysdriver file. This might help if the path to the R installation contains spaces. Conversely, at least some LuaTeX versions require this to be FALSE.

Details

This function creates a "LaTeXpackage" object that provides support for the LaTeX xcolor package.

This allows TikZ pictures to be included in LaTeX snippets. when calling grid.latex.

The "tikzPicture" package is provided for convenience if the LaTeX snippet only consists of TikZ code.

Two predefined packages are pre-registered under the names "tikz" and "tikzPicture".

Value

A "LaTeXpackage" object.

Note

If "tikzmark" is one of the packages, then a new command, \xdvirtikzmark{label}, is defined to allow saved positions also to be recorded in the rendered LaTeX in R. This produces nullGrob objects at the relevant locations plus anchors (for justification) at the relevant locations.

Author(s)

Paul Murrell

Examples

cat(author("test", packages="tikz"), sep="\n")
cat(author("test", packages="tikzPicture"), sep="\n")

xdvir documentation built on Aug. 8, 2025, 7:12 p.m.