View source: R/latexCheckOptions.R
| latexSetOptions | R Documentation |
Set the options for use of latex; check
whether the options for latex functions have been specified:
if any of
options()[c("latexcmd","dviExtension","xdvicmd")]
are NULL, an error message is displayed.
latexSetOptions(
latexcmd=c("pdflatex", "latex"),
dviExtension={
if (is.null(latexcmd)) NULL
else
switch(latexcmd,
pdflatex="pdf",
latex="dvi")
},
xdvicmd={
if (is.null(latexcmd)) NULL ## dvips is used, .ps in wd displayed
else
switch(latexcmd,
pdflatex=if (nchar(Sys.which("open")))
"open" ## Macintosh, Windows, SMP linux
else
"xdg-open", ## ubuntu linux
latex="dvips") ##
## dvips Mac, Win: .ps in wd displayed
## xdvi Mac: Quartz displays image borders
## and waits until dismissed.
## xdvi Windows: not on my machine.
## yap Windows: dvi is displayed
## open Mac: nothing happens
## open Windows: yap displays dvi
}
)
latexCheckOptions(...)
latexcmd, dviExtension, xdvicmd |
See |
... |
Any arguments to |
These are my recommendations (the default when no arguments are
specified)
for pdflatex:
options(latexcmd="pdflatex") ## Macintosh, Windows, linux
options(dviExtension="pdf") ## Macintosh, Windows, linux
if (nchar(Sys.which("open"))) {
options(xdvicmd="open") ## Macintosh, Windows, SMP linux
} else {
options(xdvicmd="xdg-open") ## ubuntu linux
}
These are my recommendations for latex (and are the settings
when only the first argument is set to "latex"):
options(latexcmd="latex")
options(dviExtension="dvi")
options(xdvicmd="dvips")
For latexSetOptions, the invisible list of the options that were set
by this command.
For latexCheckOptions, if any NULL options are detected, the
error message is printed. If all three options have non-NULL values, NULL.
Richard M. Heiberger <rmh@temple.edu>
latex
## Not run:
latexSetOptions() ## default
latexSetOptions("pdflatex") ## same as default
latexSetOptions("pdflatex", "pdf", "open") ## same as default on Macintosh, Windows, SMP Unix
latexSetOptions("latex")
latexSetOptions("latex", "dvi", "dvips") ## same as above
latexSetOptions(NULL)
latexSetOptions(NULL, NULL, NULL) ## same as above
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.