LaTeXpackage: Define a LaTeX Package.

View source: R/package.R

LaTeXpackageR Documentation

Define a LaTeX Package.

Description

Define and register a LaTeX package for authoring, typesetting, and rendering LaTeX documents.

Usage

LaTeXpackage(name,
             preamble=NULL,
             prefix=NULL,
             suffix=NULL,
             special=NULL,
             init=NULL,
             final=NULL)
registerPackage(package)

Arguments

name

Character name for the package.

preamble, prefix, suffix

Character preamble, prefix, and suffix for authoring LaTeX documents.

special

Function for handling DVI specials during rendering.

init, final

Functions to initialise package before rendering and finalise after rendering.

package

A "LaTeXpackage" object.

Details

For simple cases, all that is required is a package name and a preamble that just contains a \usepackage command. See the example below.

More complex cases may involve adding a prefix and a suffix that, for example, begins and ends a 'LaTeX' environment.

Advanced cases may involve writing functions init, special, and final, which are called to handle DVI specials. The predefined support for 'TikZ' is a particularly complicated example.

Value

LaTeXpackage() returns a "LaTeXpackage" object.

Author(s)

Paul Murrell

Examples

LaTeXpackage("times", "\\usepackage{times}")

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