Create a standalone png snippet using latex and dvipng from an stable
object; both functions are required to be installed for this to work.
The resultant png file is saved on disk and the relative path to the file
is returned. st2png() is an alias to st_as_png().
Usage
st_aspng(
x,
stem = "pmt-standalone-preview",
dir = tempdir(),
font = "helvetica",
textwidth = getOption("pmtables.text.width", 6.5),
border = getOption("pmtables.image.border", "0.2cm 0.7cm"),
ntex = 1,
dpi = 200
)
st2png(
x,
stem = "pmt-standalone-preview",
dir = tempdir(),
font = "helvetica",
textwidth = getOption("pmtables.text.width", 6.5),
border = getOption("pmtables.image.border", "0.2cm 0.7cm"),
ntex = 1,
dpi = 200
)Arguments
- x
an stable object; this can be the result of calling
stable()orstable_long().- stem
used to build intermediate and output file names.
- dir
directory for building the pdf file.
- font
the font to use; alternative values include
robotoandutopia; passed tost_to_standalone().- textwidth
the page width (in inches) when building with
pdflatex; passed tost_to_standalone(); see details.- border
passed as an option to
standalonelatex output type; see details.- ntex
number of times to build the pdf file
- dpi
dots per inch for the resulting
pngfile; used bydvipngwhen convertingdvifile to the finalpngresult.
