\HeaderA{weaveR}{function to weave a file}{weaveR}
\keyword{file}{weaveR}
\keyword{documentation}{weaveR}
\keyword{programming}{weaveR}
\begin{Description}\relax
\code{weaveR} reads a file that is written according to
the rules of the \code{noweb} system and performs a simple kind
of weaving. As a result a LaTeX file is generated.
\end{Description}
\begin{Usage}
\begin{verbatim}
weaveR(in.file,out.file)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{in.file}] name of input file 
\item[\code{out.file}] name of output file; if missing the extension of the
input file is turned to \code{.tex} 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
General remarks: A \code{noweb} file consists of a mixture of text
and code chunks. An \code{@} character (in column 1 of a line)
indicates the beginning of a text chunk. \code{<{}<name of code chunk>{}>=}
(starting at column 1 of a line) is a header line of a code chunk with
a name defined by the text between \code{<{}<} and \code{>{}>=}.
A code chunk is finished by the beginning of hte next text chunk.
Within the code chunk you are allowed to use other code chunks by referencing
them by name ( for example by: \code{<{}<name of code chunk>{}>} ).
In this way you can separate a big job in smaller ones.

Technical remarks:
To format small pieces of code in text chunks you have to put them in
\code{[[...]]}-brackets: \code{text text [[code]] text text}.
One occurence of such a code in a text line is assumed to work always.
If an error emerges caused by formatting code in a text chunk
simplify the line by splitting it.
Sometimes you want to use
\code{[[}- or even \code{<{}<}-characters in your text. Then it
may be necessary to escape them by an \code{@}-sign and
you have to type in: \code{@<{}<}, \code{@[[} and so on.

\code{weaveR} expands the input by adding some latex macros
to typeset code by a typewriter font.
Furthermore chunk numbers are appended to code chunk headers.
The number of the last code chunk is stored in LaTeX-counter \code{Rchunkno}.
After defining
\code{\\newcommand\{\\chunklabel\}[1]\{\\newcounter\{\#1\}\\setcounter\{\#1\}\{\\value\{Rchunkno\} \} \}}
and \code{\\newcommand\{\\chunkref\}[1]\{\\arabic\{\#1\} \} } you can label a code chunk
by \code{\\chunklabel\{xyzname\} } and reference it by \code{\\chunkref\{xyzname\} }.
\end{Details}
\begin{Value}
a latex file is generated
\end{Value}
\begin{Author}\relax
Hans Peter Wolf
\end{Author}
\begin{References}\relax
\url{http://www.eecs.harvard.edu/~nr/noweb/intro.html}
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{tangleR}{tangleR}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Not run: 
## This example cannot be run by examples() but should be work in an interactive R session
  weaveR("testfile.rev","testfile.tex")
  weaveR("testfile.rev")
## End(Not run)
## The function is currently defined as
weaveR<-function(in.file,out.file){
  # german documentation of the code:
  # look for file webR.pdf, P. Wolf 050204
  ...
}
\end{ExampleCode}
\end{Examples}

