<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Preview Spork as Latex</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="https://rpkg.net/assets/examples.css" />
</head><body>

<table width="100%" summary="page for as_preview.latex"><tr><td>as_preview.latex</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Preview Spork as Latex</h2>

<h3>Description</h3>

<p>Preview spork after conversion to latex.
Creates and displays a temporary png file, after
conversion from pdf using <code>ghostconvert</code>.
</p>


<h3>Usage</h3>

<pre>
## S3 method for class 'latex'
as_preview(
  x,
  wide = 70,
  long = 20,
  stem = "latex_preview",
  dir = tempdir(),
  gs_cmd = getOption("gs_cmd", "mgs"),
  preamble = "\\usePackage{amsmath}\\n",
  prolog = "\\begin{center}",
  epilog = "\\end{center}",
  ...
)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>x</code></td>
<td>
<p>spork; see <code>as_spork</code></p>
</td></tr>
<tr valign="top"><td><code>wide</code></td>
<td>
<p>nominal page width</p>
</td></tr>
<tr valign="top"><td><code>long</code></td>
<td>
<p>nominal page length</p>
</td></tr>
<tr valign="top"><td><code>dir</code></td>
<td>
<p>a working directory; see <code>as.pdf</code></p>
</td></tr>
<tr valign="top"><td><code>gs_cmd</code></td>
<td>
<p>ghostscript command; see <code>ghostconvert</code></p>
</td></tr>
<tr valign="top"><td><code>prolog</code></td>
<td>
<p>passed to <code>as.document</code></p>
</td></tr>
<tr valign="top"><td><code>epilog</code></td>
<td>
<p>passed to <code>as.document</code></p>
</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
<p>passed arguments</p>
</td></tr>
</table>


<h3>Value</h3>

<p>invisible filepath
</p>


<h3>See Also</h3>

<p>Other preview: 
<code>as.png.plotmath()</code>,
<code>as.png.spork()</code>,
<code>as_preview.plotmath()</code>,
<code>as_previews.spork()</code>,
<code>as_previews()</code>,
<code>as_preview()</code>,
<code>ggplot.plotmath()</code>,
<code>ggplot.spork()</code>
</p>


<h3>Examples</h3>

<pre>

# library(magrittr)
# 'one joule (Omega) ~ 1 kg*m^2./s^2' %&gt;%
# as_spork %&gt;%
# as_latex %&gt;%
#as_preview

</pre>


</body></html>
