View source: R/sanitize_latex.R
sanitize_latex | R Documentation |
sanitize_latex
translates particular items in
character strings to LaTeX format, e.g., makes a^2 = a\$^2\$
for superscript within variable labels. LaTeX names of greek letters
(e.g., "alpha") will have backslashes added if greek==TRUE
.
Math mode is inserted as needed. sanitize_latex
assumes that
input text always has matches, e.g. [) [] (] ()
, and that
surrounding by \$\$
is OK.
sanitize_latex(
object,
inn = NULL,
out = NULL,
pb = FALSE,
greek = FALSE,
na = "",
...
)
object |
|
inn |
|
out |
|
pb |
|
greek |
|
na |
|
... |
Additional arguments for other methods. Currently ignored. |
Vector of chracter strings.
This code is lifted from the Hmisc
package in order to
avoid depending on that package.
Frank E. Harrell Jr.
Department of Biostatistics,
Vanderbilt University,
f.harrell@vanderbilt.edu
Richard M. Heiberger,
Department of Statistics,
Temple University, Philadelphia, PA.
rmh@temple.edu
David R. Whiting,
School of Clinical Medical Sciences (Diabetes),
University of Newcastle upon Tyne, UK.
david.whiting@ncl.ac.uk
Hmisc::latexTranslate
, Hmisc::sedit
sanitize_latex("75% of the cars were | more than $20,000 Delta = 1.30", greek = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.