Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote branch 'cam/beta'

Conflicts:
	man/sanitizeTexString.Rd
	man/tikz.Rd
  • Loading branch information...
commit bc8fdb7268d6b7cc54755cfbe907308a07287a0c 2 parents 5232b2a + c094e8e
@Sharpie authored
View
6 R/latexStrWidth.R
@@ -202,7 +202,7 @@ function( TeXMetrics ){
# We calculate width for both characters and strings.
writeLines("\\path let \\p1 = ($(TeX.east) - (TeX.west)$),
- \\n1 = {veclen(\\x1,\\y1)} in
+ \\n1 = {veclen(\\x1,\\y1)} in (TeX.east) -- (TeX.west)
node{ \\typeout{tikzTeXWidth=\\n1} };", texIn)
# We only want ascent and descent for characters.
@@ -210,12 +210,12 @@ function( TeXMetrics ){
# Calculate the ascent and print it to the log.
writeLines("\\path let \\p1 = ($(TeX.north) - (TeX.base)$),
- \\n1 = {veclen(\\x1,\\y1)} in
+ \\n1 = {veclen(\\x1,\\y1)} in (TeX.north) -- (TeX.base)
node{ \\typeout{tikzTeXAscent=\\n1} };", texIn)
# Calculate the descent and print it to the log.
writeLines("\\path let \\p1 = ($(TeX.base) - (TeX.south)$),
- \\n1 = {veclen(\\x1,\\y1)} in
+ \\n1 = {veclen(\\x1,\\y1)} in (TeX.base) -- (TeX.south)
node{ \\typeout{tikzTeXDescent=\\n1} };", texIn)
}
View
10 man/sanitizeTexString.Rd
@@ -30,8 +30,12 @@ Cameron Bracken \email{cameron.bracken@gmail.com}
\code{\link{tikz}}
}
\examples{
- # Although we may want -1 to be a superscript it gets sanitized away with
- # the other default special characters
- # sanitizeTexString('10\% of 10\$ is 10^{-1}\$')
+ # Be careful with sanitizing, it may lead to unexpected behavior.
+ # For example, we may want -1 to be a superscript it gets
+ # sanitized away with the other default special characters.
+ # The string appears in LaTeX exactly as shown.
+\dontrun{
+ sanitizeTexString('10% of 10$ is 10^{-1}$')
+}
}
\keyword{ character }
View
4 man/tikz.Rd
@@ -111,12 +111,12 @@ Multiple plots will be placed as separate environments in the output file.
}
\section{Options That Affect Package Behavior}{
-The \pkg{tikzDevice} package is currently influenced by a number of global options that may be set your \R{} scripts, in the \R{} console or in your in a \code{.Rprofile} file. All of the options can be set by using \code{options(<option> = <value>)}. These options allow for the use of custom \code{documentclass} declarations, LaTeX packages, and typesetting engines (e.g. XeLaTeX). The defaults , if are any for a given option, are shown below the description. The global options are:
+The \pkg{tikzDevice} package is currently influenced by a number of global options that may be set your \R\ scripts, in the \R\ console or in your in a \code{.Rprofile} file. All of the options can be set by using \code{options(<option> = <value>)}. These options allow for the use of custom \code{documentclass} declarations, LaTeX packages, and typesetting engines (e.g. XeLaTeX). The defaults , if are any for a given option, are shown below the description. The global options are:
\describe{
\item{\code{tikzLatex}}{ Specifies the location of the LaTeX compiler to be used by \pkg{tikzDevice}. Setting this option may help the package locate a missing compiler. The default is searched for when the package is loaded, otherwise it can be set manually. This option may be set as follows: \code{options( tikzLatex = '/path/to/latex/compiler' )}.}
-\item{\code{tikzMetricsDictionary}}{ When using the graphics device provided by \pkg{tikzDevice}, you may notice that \R{} appears to ``lag" or ``hang" when commands such as \code{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 \R{} becomes unresponsive for a while. The good news is that the \code{tikz()} code is designed to cache the results of these computations so they need only be performed once for each string or character. By default, these values are stored in a temporary cache file which is deleted when \R{} is shut down. A location for a permanent cache file may be specified by setting the value of \code{tikzMetricsDictionary} in \code{.Rprofile} with \code{options( tikzMetricsDictionary = '/path/to/dictionary/location' )}.}
+\item{\code{tikzMetricsDictionary}}{ When using the graphics device provided by \pkg{tikzDevice}, you may notice that \R\ appears to ``lag" or ``hang" when commands such as \code{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 \R\ becomes unresponsive for a while. The good news is that the \code{tikz()} code is designed to cache the results of these computations so they need only be performed once for each string or character. By default, these values are stored in a temporary cache file which is deleted when \R\ is shut down. A location for a permanent cache file may be specified by setting the value of \code{tikzMetricsDictionary} in \code{.Rprofile} with \code{options( tikzMetricsDictionary = '/path/to/dictionary/location' )}.}
\item{\code{tikzDocumentDeclaration}}{A string. The LaTeX documentclass declaration used in output files when \code{standAlone == TRUE}. \code{tikzDocumentDeclaration} also influences the calculation of font metrics. The default value is:
View
1  man/tikzAnnotate.Rd
@@ -87,6 +87,7 @@ Cameron Bracken <cameron.bracken@gmail.com>
dev.off()
}
}
+
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ device }
Please sign in to comment.
Something went wrong with that request. Please try again.