getLatexStrWidth(texString, cex = 1, face = 1, engine = getOption("tikzDefaultEngine"), documentDeclaration = getOption("tikzDocumentDeclaration"), packages, verbose = interactive())
getLatexCharMetrics(charCode, cex = 1, face = 1, engine = getOption("tikzDefaultEngine"), documentDeclaration = getOption("tikzDocumentDeclaration"), packages, verbose = interactive())
TRUE
in
interactive mode only, to FALSE
otherwise.as.integer
. Non-numeric values will not be accepted.texString
in points.tikz
device for proper
string placement in graphics. Both functions check to see if metrics exist
in a global or temporary dictionary (as defined in
options('tikzMetricsDictionary')
) and if so will pull the metrics
from there. If the dictionary does not exist, then a temporary one is
created for the current R session. Metrics are calculated via system
calls to LaTeX compilers. Querying compilers to calculate metrics is
expensive and so we strongly recommend setting
options('tikzMetricsDictionary') <- '/path/to/dictionary'
to create a
global dictionary.
getLatexStrWidth('{\\\\tiny Hello \\\\LaTeX!}')
# Calculate ascent, descent and width for "A"
getLatexCharMetrics(65)
Run the code above in your browser using DataLab