Learn R Programming

spork (version 0.3.5)

as_preview.latex: Preview Spork as Latex

Description

Preview spork after conversion to latex. Creates and displays a temporary png file, after conversion from pdf using ghostconvert.

Usage

# S3 method for latex
as_preview(
  x,
  wide = 70,
  long = 20,
  stem = "latex_preview",
  dir = tempdir(),
  gs_cmd = getOption("gs_cmd", "mgs"),
  morePreamble = ifelse(getOption("spork_upgreek", TRUE), "\\usepackage{upgreek}\n",
    NULL),
  prolog = "\\begin{center}",
  epilog = "\\end{center}",
  ...
)

Value

invisible filepath

Arguments

x

spork; see as_spork

wide

nominal page width

long

nominal page length

dir

a working directory; see as.pdf

gs_cmd

ghostscript command; see ghostconvert

morePreamble

additional text to insert in preamble; passed to as.pdf

prolog

passed to as.document

epilog

passed to as.document

...

passed arguments

See Also

Other preview: as.png.plotmath(), as.png.spork(), as_preview(), as_preview.html(), as_preview.plotmath(), as_previews(), as_previews.default(), as_previews.spork(), ggplot.plotmath(), ggplot.spork()

Examples

Run this code
# \donttest{
# library(magrittr)
# 'one joule (Omega) ~ 1 kg*m^2./s^2' %>%
# as_spork %>%
# as_latex %>%
#as_preview
# }

Run the code above in your browser using DataLab