grid.latex | R Documentation |
Author, typeset, and render LaTeX in R graphics.
latexGrob(tex,
x=0.5, y=0.5,
margin=0, rot=0,
default.units="npc",
hjust="centre", vjust="centre",
width=NA,
dpi=NA,
page=1,
packages=NULL,
engine=getOption("xdvir.engine"),
fontLib=getOption("xdvir.fontLib"),
texFile=NULL,
name=NULL,
gp=gpar(),
vp=NULL)
grid.latex(...)
xelatexGrob(tex, ...)
grid.xelatex(...)
lualatexGrob(tex, ...)
grid.lualatex(...)
tex |
LaTeX code as a character vector. |
x , y |
Numeric values or units specifying where to draw the output. |
margin |
Numeric values or units specifying margins (in the order bottom, left, top, right). Recycled if necessary. |
rot |
Rotation angle (in degrees). |
default.units |
Units to use if |
hjust , vjust |
Justification of the output relative to the
|
width |
Either |
dpi |
Resolution (dots per inch) for rendering. |
page |
Which page should be drawn. |
packages |
The LaTeX packages to be used.
May be the name of a LaTeX package (character) or a
|
engine |
The TeX engine that should be used to render the LaTeX.
May be the name of a TeX engine (character)
or a |
fontLib |
The font libraary the should be used to query fonts and glyphs. |
name |
Character value giving name for the grob. |
gp |
Graphical parameter settings. |
vp |
A viewport or |
texFile |
Name of a file to use for LaTeX code. |
... |
Arguments passed to |
grid.latex()
takes a LaTeX fragment, generates a LaTeX
document, typesets it, reads the resulting DVI file and renders the
result.
grid.xelatex()
is just a convenient front end for
grid.latex()
, with appropriate default engine
.
grid.latex()
attempts to be smart about
delaying typesetting until drawing time if necessary in order
to get the correct context for width
and gp
settings.
This means that, unless gp
is set to NULL
and
width
is set to either NA
or an
absolute unit (e.g., a number of inches), the calculation of, for
example, the width of a grob will be less efficient
because the typesetting has to be performed
all over again.
A "DVIgrob"
object.
Paul Murrell
LaTeXpackage
.
## Not run:
# Requires TeX installation
grid.latex("this is a test")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.