Learn R Programming

xdvir (version 0.1-3)

LaTeXpackage: 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)

Value

LaTeXpackage() returns a "LaTeXpackage" object.

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.

Author

Paul Murrell

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.

Examples

Run this code
LaTeXpackage("times", "\\usepackage{times}")

Run the code above in your browser using DataLab