fontspecPackage: LaTeX Package fontspec.

View source: R/fontspec.R

fontspec PackageR Documentation

LaTeX Package fontspec.

Description

Define a LaTeXPackage for the LaTeX fontspec package.

Usage

fontspecPackage(font=NULL, name=font)

Arguments

font

The name of a font to use as the main font. See details.

name

The name of the resulting package.

Details

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

The font argument provides some convenience for setting the main font to be used. The font can be the common name of a system font or a complete path to the font file.

For more complex situations, fontspec commands can be added to the LaTeX code that is sent to functions like author and grid.latex (see the Examples).

A predefined package, with no main font defined, is pre-registered under the name "fontspec".

Value

A "LaTeXpackage" object.

Author(s)

Paul Murrell

Examples

cat(author("test", packages="fontspec"), sep="\n")
cat(author("test", packages=fontspecPackage(font="Courier")), sep="\n")
tex <- "\\setmainfont{fontname.ttf}[Path=/path/to/font/]\ntest"
cat(author(tex, packages="fontspec"), sep="\n")

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