Run Sweave and Patch
SweaveMiktex.Rd
This is a simple script to run Sweave, then convert the LaTeX file, then patch it.
Usage
SweaveMiktex(Rnw, main,
cmd = "texify",
options = "--tex-option=-src-specials --tex-option=-interaction=nonstopmode",
includedir = "--tex-option=--include-directory=",
stylepath = FALSE,
source.code = NULL,
make = 1,
preview = 'yap "%s"',
patchLog=TRUE,
sleep = 0, ...)
SweavePDFMiktex(Rnw, main,
cmd = "texify --pdf",
options = "--tex-option=-synctex=-1 --tex-option=-interaction=nonstopmode",
includedir = "--tex-option=-include-directory=",
stylepath = FALSE,
source.code = NULL,
make = 1,
preview = NULL,
patchLog = TRUE,
sleep = 0, ...)
SweaveDVI(Rnw, main,
texinputs = NULL,
source.code = NULL,
make = 1,
links = NULL,
preview = NULL,
patchLog = TRUE, ...)
SweavePDF(Rnw, main,
texinputs = NULL,
source.code = NULL,
make = 1,
links = NULL,
preview = NULL,
patchLog = TRUE, ...)
SweaveDVIPDFM(Rnw, main,
latex = "latex", latexOpts = "-synctex=1 -interaction=nonstopmode",
dvipdfm = "dvipdfm", dvipdfmOpts = "",
texinputs = NULL,
source.code = NULL,
make = 1,
preview = NULL,
patchLog = TRUE, ...)
Arguments
- Rnw
The .Rnw input file
- main
The .tex file on which to run latex, defaulting to the output file from Sweave
- cmd
The LaTeX command to run
- options
Options to pass to LaTeX
- includedir
The prefix for an option to give the location of Sweave.sty
- stylepath
stylepath
argument to pass toSweave
- source.code
If not
NULL
, a filename to source before runningSweave
- make
Value to pass to
SweaveAll
to control which Sweave files are processed- preview
Command to use to preview result, or
NULL
for no preview- patchLog
Whether to attempt to patch the console log and
.log
file- sleep
Number of seconds to sleep if an error is detected in the run
- texinputs
Extra paths to pass to
texi2dvi
- links
If not
NULL
, an option to turn on production of source links via Synctex or source specials- latex,latexOpts
The function to call to convert the
.tex
to.dvi
, and options to put on the command line.- dvipdfm, dvipdfmOpts
The function to call to convert the
.dvi
to.pdf
, and options to put on the command line.- ...
Additional options to pass to
SweaveAll
Details
If the Rnw
argument is a filename ending in .tex
, then
weaving is skipped, but the .dvi
file is still patched (because
one of the other files in the project might have come from Sweave).
The source.code
argument may be used to temporarily install code before
running the document through the weaver (e.g. Sweave
).
It could install
an experimental version of Sweave
, or set up some variables
to be used by other code chunks, etc. (Note that things are sourced locally,
whereas Sweave
runs things in the global environment,
so the file will need to make explicit assignments there, and it should
avoid using names that clash with the argument names to SweaveMiktex
or SweavePDFMiktex
.)
The functions invoke Latex differently. SweaveMiktex
is designed
to call Miktex's texify
command to produce a .dvi
file. SweavePDFMiktex
does the same, but produces a .pdf
. SweaveDVI
and SweavePDF
are similar, but use a modified version of R's texi2dvi
function to invoke Latex. SweaveDVIPDFM
does the conversion to
.pdf
in two stages.
The patchLog
option makes use of the new patchLog
function.