tikz
ouput device which
generates R graphics in a LaTeX friendly format. LaTeX handles the
typesetting of all text in graphics generated by tikz
. This allows for
seamless integration between these graphics and documents that are also being
typeset by LaTeX. Using LaTeX to generate graph text also means that
LaTeX mathematics can be typeset directly into labels and
annotationstikz
tikzDefaultEngine
pdftex
or xetex
which will respectively trigger the use of the pdflatex
and
xelatex
compilers.tikzLatex
options( tikzLatex = '/path/to/latex/compiler' )
.tikzXelatex
tikzLatex
, except this option specifies the
location of the XeLaTeX compiler.tikzMetricsDictionary
plot()
are executed. This is because the device must query the
LaTeX compiler for string widths and font metrics. For a normal plot,
this may happen dozens or hundreds of times- hence RtikzDocumentDeclaration
tikzLatexPackages
tikzXelatexPackages
tikzFooter
tikzMetricPackages
tikzUnicodeMetricPackages
tikzSanitizeCharacters
tikzReplacementCharacters
tikzRasterResolution
tikzPdftexWarnUTF
tikzDevice
is to provide seamless
integration between text in Rcex
argument to functions such aspar
.ps
argument
to functions such aspar
or thefontsize
argument to
functions such asgpar
.pdftex
, the typesetting engine most commonly used to compile
LaTeX documents, has no native support for Unicode. Recently, two new engines
have become widely available that do support Unicode natively. These engines
are:
xetex
engine which has been a part of standard TeX
distributions since TeX Live 2007 and MiKTeX 2.7.luatex
engine which is a direct sucessor topdftex
.
LuaTeX is still considered `beta' software (as of spring 2011) but has been
included in standard TeX distributions since TeX Live 2008 and MiKTeX 2.9. As of Version 0.6.0, the tikzDevice package includes support for the
xetex
engine provided a recent version of TeX Live or MiKTeX is
available.
The tikzDevice defaults to using the pdftex
engine, but this may be
changed by setting an option: option(tikzDefaultEngine = 'xetex')
.
When working with text that contains Unicode characters, we strongly
reccomend switching to the xetex
engine and the package will produce
warning messages when multibyte characters are sent to the pdftex
engine. Users who find these warnings annoying may disable them by setting
options(tikzPdftexWarnUTF = FALSE)
as it is possible to send Unicode
information to the pdftex
engine with the following caveats:
options(tikzLatexPackages)
may need to be customized in order to get
proper behavior.getLatexCharMetrics
function will always return 0
for ascent, descent and width when passed a character code outside the
range 32--127 when using thepdftex
engine. When using the xetex
engine, Unicode support is enabled by loading the
LaTeX packages fontspec
and xunicode
. Using this setup, support
for Unicode characters should be limited only by the fonts used in the
document. The font selection may be adjusted using
options(tikzXelatexPackages)
.
tikz