Skip to content

Commit

Permalink
Markup.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@85868 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Feb 6, 2024
1 parent 2e4679e commit 474f0ea
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/library/utils/vignettes/Sweave.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ of code and documentation segments, called \emph{chunks}:
the contents of documentation chunks, and so will identify chunk
indicators even inside \LaTeX{} verbatim environments.

\item[Code chunks] start with \verb|<<|\code{\textsl{options}}\verb|>>=| at the beginning of
\item[Code chunks] start with \verb|<<|\code{\var{options}}\verb|>>=| at the beginning of
a line; again the rest of the line is a comment and ignored.
\end{description}
The default for the first chunk is documentation.
Expand Down Expand Up @@ -200,7 +200,7 @@ Sweave which control the final output.

Options control how code chunks and their output (text, figures) are
transferred from the \file{.Rnw} file to the \file{.tex} file. All
options have the form \code{\textsl{key}=\textsl{value}}, where \code{\textsl{value}} can be
options have the form \code{\var{key}=\var{value}}, where \code{\var{value}} can be
a number, string or logical value. Several options can be specified at
once (separated by commas), all options must take a value (which must
not contain a comma or equal sign). Logical options can take the
Expand All @@ -213,15 +213,15 @@ In the \file{.Rnw} file options can be specified either
modifying the behaviour \emph{only for this chunk}, or
\item anywhere in a documentation chunk using the command %
\begin{quote}
\verb|\SweaveOpts{|\code{\textsl{opt1}=\textsl{value1}, \textsl{opt2}=\textsl{value2}, ..., \textsl{optN}=\textsl{valueN}}\verb|}|
\verb|\SweaveOpts{|\code{\var{opt1}=\var{value1}, \var{opt2}=\var{value2}, ..., \var{optN}=\var{valueN}}\verb|}|
\end{quote}
which modifies the defaults for the rest of the document, i.e.,
\emph{all code chunks after the statement}. Hence, an
\verb|\SweaveOpts| statement in the preamble of the document sets
defaults for all code chunks.
\end{enumerate}
Further, global options can be specified (as a comma-separated list of
\code{\textsl{key}=\textsl{value}} items) in the environment variable
\code{\var{key}=\var{value}} items) in the environment variable
\env{SWEAVE\_OPTIONS}, and via the \option{--options=} flag of
\command{R CMD Sweave}.

Expand Down Expand Up @@ -272,12 +272,12 @@ The help pages for \code{RweaveLatex} and \code{Rtangle} list the
options supported by the default \code{Sweave} and \code{Stangle} drivers.

Now for the promised details on the file names corresponding to
figures. These are of the form \texttt{\textsl{prefix}-\textsl{label}.\textsl{ext}}. Here
\texttt{\textsl{prefix}} can be set by the option \code{prefix.string},
figures. These are of the form \code{\var{prefix}-\var{label}.\var{ext}}. Here
\code{\var{prefix}} can be set by the option \code{prefix.string},
otherwise is the basename of the output file (which unless specified
otherwise is the basename of the input file). \texttt{\textsl{label}} is the
otherwise is the basename of the input file). \code{\var{label}} is the
label of the code chunk if it has one, otherwise the number of the
code chunk in the range \texttt{001} to \texttt{999}. \texttt{\textsl{ext}} is
code chunk in the range \texttt{001} to \texttt{999}. \code{\var{ext}} is
the appropriate extension for the type of graphics, e.g.{}
\code{pdf}, \code{eps}, \ldots{}. So for the
\file{example-1.Rnw} file, the PDF version of the boxplot is
Expand All @@ -303,7 +303,7 @@ encoding as the main file.
\subsection{Using scalars in text}

There is limited support for using the values of \R{} objects in text
chunks. Any occurrence of \verb|\Sexpr|\verb|{|\code{\textsl{expr}}\verb|}|
chunks. Any occurrence of \verb|\Sexpr|\verb|{|\code{\var{expr}}\verb|}|
is replaced by the string resulting from coercing the value of the
expression \code{expr} to a character vector; only the first element
of this vector is used. E.g., \verb|\Sexpr{sqrt(9)}| will be replaced
Expand Down Expand Up @@ -381,7 +381,7 @@ SweaveSyntConv(rnwfile, SweaveSyntaxLatex)

Code chunks are now enclosed in \code{Scode}
environments, code chunk reuse is performed using
\verb|\Scoderef{|\code{\textsl{chunkname}}\verb|}|. All other operators are the same as in
\verb|\Scoderef{|\code{\var{chunkname}}\verb|}|. All other operators are the same as in
the \code{noweb}-style syntax.

Which syntax is used for a document is determined by the extension of
Expand Down Expand Up @@ -446,7 +446,7 @@ figures. It is the user's responsibility that the text inclusions are
covered by the declared input encoding. \LaTeX{} allows the input
encoding to be changed by
\begin{quote}
\verb|\inputencoding{|\code{\textsl{something}}\verb|}|
\verb|\inputencoding{|\code{\var{something}}\verb|}|
\end{quote}
statements: these may not work well in Sweave processing. Since
\verb|\usepackage[latin1]{inputenc}| is typically not legal \LaTeX{} code
Expand Down

0 comments on commit 474f0ea

Please sign in to comment.