Rev 59039 | Rev 63690 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/tools/man/texi2dvi.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2011 R Core Team% Distributed under GPL 2 or later\name{texi2dvi}\alias{texi2dvi}\alias{texi2pdf}\title{Compile LaTeX Files}\description{Run \code{latex} and \code{bibtex} until all cross-references areresolved and create either a dvi or PDF file.}\usage{texi2dvi(file, pdf = FALSE, clean = FALSE, quiet = TRUE,texi2dvi = getOption("texi2dvi"),texinputs = NULL, index = TRUE)texi2pdf(file, clean = FALSE, quiet = TRUE,texi2dvi = getOption("texi2dvi"),texinputs = NULL, index = TRUE)}\arguments{\item{file}{character. Name of LaTeX source file.}\item{pdf}{logical. If \code{TRUE}, a PDF file is produced instead ofthe default dvi file (\code{texi2dvi} command line option \option{--pdf}).}\item{clean}{logical. If \code{TRUE}, all auxiliary files are removed(\code{texi2dvi} command line option \option{--clean}). May not work onsome platforms.}\item{quiet}{logical. No output unless an error occurs. Ignored ifemulation (see the \code{texi2dvi} argument) is used.}\item{texi2dvi}{character (or \code{NULL}). Script or program used tocompile a TeX file to dvi or PDF, respectively.The default (selected by \code{""} or \code{NULL}) is to look for anexecutable on the search path and otherwise emulate the script with\code{system} calls.}\item{texinputs}{\code{NULL} or a character vector of paths to add tothe LaTeX and bibtex input search paths.}\item{index}{logical: should indices be prepared?}}\details{\code{texi2pdf} is a wrapper for the common case of\code{texi2dvi(pdf = TRUE)}.Despite the name, this is used in \R to compile LaTeX files,specifically those generated from vignettes. Itensures that the \file{\var{\link{R_HOME}}/share/texmf} directory isin the \env{TEXINPUTS} path, so \R style files such as \file{Sweave}and \file{Rd} will be found. The search path used is first theexisting \env{TEXINPUTS} setting (or the current directory if unset),then elements of \code{texinputs}, then\file{\var{R_HOME}/share/texmf} and finally the defaultpath. Analogous changes are made to \env{BIBINPUTS} and\env{BSTINPUTS} settings.MiKTeX has a \code{texi2dvi} executable but no other Windows TeXinstallation that we know of does, so emulation is used on e.g. TeXLiveinstallations on Windows.Occasionally indices contain special characters which cause indexingto fail (particularly when using the \samp{hyperref} LaTeX package)even on valid input. The argument \code{index = FALSE} is provided toallow package manuals to be made when this happens: it uses emulation.}\note{There are various versions of the \command{texi2dvi} script onUnix-alikes and quite a number of bugs have been seen, some of whichthis \R wrapper works around.One that is current is that it may not work correctly for paths whichcontain spaces, nor even if the absolute path to a file would containspaces.The three possible approaches all have their quirks. For example theUnix-alike \code{texi2dvi} script removes ancillary files that alreadyexist but the other two approaches do not (and may get confused bysuch files).}\value{Invisible \code{NULL}. Used for the side effect of creating a dvi orPDF file in the current working directory (and maybe other files,especially if \code{clean = FALSE}).}\author{Originally Achim Zeileis but largely rewritten by R-core.}\keyword{utilities}