| as_previews.spork | R Documentation |
Compares plotmath and latex previews of spork Generates png for both, and overlays latex above plotmath.
## S3 method for class 'spork'
as_previews(x, wide = 70, long = 20, width = 3, height = 1, sleep = 2, ...)
x |
length-one spork |
wide |
width in mm of the latex image |
long |
length in mm of the latex image |
width |
width (default: inches) of the plotmath image |
height |
height (default: inches) of the plotmath image |
sleep |
how long to pause after html before latex/plotmath |
... |
passed arguments |
invisible list of filepaths
Other preview:
as.png.plotmath(),
as.png.spork(),
as_preview(),
as_preview.html(),
as_preview.latex(),
as_preview.plotmath(),
as_previews(),
as_previews.default(),
ggplot.plotmath(),
ggplot.spork()
Other interface:
as.expression.plotmath(),
as_html.spar(),
as_html.spork(),
as_latex.spar(),
as_latex.spork(),
as_plotmath.spar(),
as_plotmath.spork(),
as_spork.character(),
htmlToken(),
latexToken(),
plotmathToken()
Other spork:
[.spork(),
[[.spork(),
as.list.spork(),
as.png.spork(),
as_html.spork(),
as_latex.spork(),
as_plotmath.spork(),
as_spar.default(),
as_spar.spork(),
as_spork(),
as_spork.character(),
as_spork.factor(),
as_spork.spork(),
ggplot.spork(),
greek()
library(magrittr)
specials <- '& % $ # \\_ { } ~ \\^ \\'
# specials %>% as_spork %>% as_previews
# specials %>% gsub(' ','',.) %>% as_spork %>% as_previews
# 'one joule (Omega) ~ 1 kg*m^2./s^2' %>% as_spork %>% as_previews
# disambiguation for plotmath and latex (see \code{\link[grDevices]{plotmath}}):
# 'epsilon.varepsilon' %>% as_spork %>% as_previews
# 'rho.varrho' %>% as_spork %>% as_previews
# 'Upsilon.Upsilon1' %>% as_spork %>% as_previews
# 'phi.phi1.varphi' %>% as_spork %>% as_previews
# 'sigma.sigma1.varsigma.stigma' %>% as_spork %>% as_previews
# 'theta.vartheta.theta1' %>% as_spork %>% as_previews
# 'omega.omega1.pi.varpi' %>% as_spork %>% as_previews
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.