[Rd] Error in generating sweave-tex -> pdf file

Zhang,Jun JHZhang at mdanderson.org
Wed Dec 22 20:04:38 CET 2010


Define the envvar LC_ALL with value "C" will reduce the texi2dvi error. Sweave.sty need to be at the right location depend on the kind of tex installation.

Jun

----- Original Message -----
From: carol white [mailto:wht_crl at yahoo.com]
Sent: Wednesday, December 22, 2010 12:30 PM
To: Duncan Murdoch <murdoch.duncan at gmail.com>
Cc: r-devel at r-project.org <r-devel at r-project.org>
Subject: Re: [Rd] Error in generating sweave-tex -> pdf file

Should the Sweave package be in /usr/share/texmf/tex/latex/? How about 
Sweave.sty?

Thanks



----- Original Message ----
From: Duncan Murdoch <murdoch.duncan at gmail.com>
To: carol white <wht_crl at yahoo.com>
Cc: r-devel at r-project.org
Sent: Wed, December 22, 2010 6:42:07 PM
Subject: Re: [Rd] Error in generating sweave-tex -> pdf file

On 22/12/2010 12:27 PM, carol white wrote:
> Hi,
> I created a Sweave file (see below). when I want to convert tex
> file generated from it into pdf, I get error message as follows:
> 
> >  texi2dvi("test.tex", pdf=TRUE)
> Error in texi2dvi("test.tex", pdf = TRUE) :
>    Running 'texi2dvi' on 'test.tex' failed.
> LaTeX errors:
> ! Undefined control sequence.
> l.8 \begin
>            {Schunk}

The Schunk, Sinput, and Soutput environments are defined in Sweave package.  
Something went wrong and latex didn't find them, either because it didn't find 
Sweave.sty, or because it did, but that file has been messed up.


> ?
> ! Interruption.
> ! Interruption.
> <to be read again>
>                     {
> l.8 \begin{
>             Schunk}
> ! Undefined control sequence.
> l.9 \begin
>            {Sinput}
> The control sequence at the end of the top line
> of your error message was never \def'ed. If you have
> ------------------------
> test.Rnw
> 
> \usepackage{Sweave}
> \ documentclass [ a4paper ]{ article }
> \ title { Sweave Example 1}
> \ begin { document }
> \ maketitle

Are there really spaces between the backslashes and the macros?  I think that 
doesn't work.  You should also have the \usepackage{Sweave} line after the 
opening \documentclass line.

Duncan Murdoch

> In this example we embed parts of the examples from the
> help page into a \ LaTeX {} document :
> <<a>>=
> y=2
> y = y +1
> @
> which shows that the location parameter of the Ozone
> distribution varies significantly from month to month . Finally we
> include a boxplot of the data :
> 
> \end{ document }
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



More information about the R-devel mailing list