Description Usage Arguments Details Value Author(s) See Also Examples
sanitizeTexString
searches character by character
through a string replacing each occurrence of a special
character contained in strip[i]
with the
corresponding replacement value in replacement[i]
.
tikzDevice calls back this function for every piece of
text when the sanitize option is TRUE. See
tikz
for more information on the default
special characters and replacement values.
1 2 3 | sanitizeTexString(string,
strip = getOption("tikzSanitizeCharacters"),
replacement = getOption("tikzReplacementCharacters"))
|
string |
A character vector of length 1 (a string). |
strip |
A character vector of single characters to search for. |
replacement |
A character vector of replacement values. |
By default, 'tikzSanitizeCharacters' replaces the following characters:
%
$
}
{
^
_
#
&
~
With the contents of 'tikzReplacementCharacters':
\%
\$
\}
\{
\^{}
\_{}
\#
\&
\char`\~
These defaults may be adjusted using the
options
function.
sanitizedString |
A character vector of length 1 with all special characters replaced. |
Cameron Bracken cameron.bracken@gmail.com
1 2 3 4 5 6 7 8 | # 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.
## Not run:
sanitizeTexString('10\% of 10$ is 10^\{-1\}$')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.