Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I just updated R to 3.0.0. I couldn't compile PDF from my .Rnw file, which I could do with R 2.15. Here is the error I got:

! Undefined control sequence.
l.192 \SweaveOpts
                 {concordance=TRUE}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

It seems related to Sweave. But I was using knitr to weave .Rnw file. Could some one help me fix the problem?

share|improve this question
1  
Welcome to TeX.sx! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Kurt Apr 12 '13 at 14:23
    
It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The StackExchange staff can merge them together for you. –  Werner Apr 13 '13 at 3:15
add comment

1 Answer

up vote 7 down vote accepted

Remove \SweaveOpts{concordance=TRUE} in your Rnw file. It is invalid and useless to knitr.

Update: I have fixed the plot problem in the development version (v1.2.4). See here for instructions on installation. It will go to the stable version 1.3 eventually, but perhaps not until a month later.

share|improve this answer
    
Yihui, Thank you so much for your quick response. I removed \SweaveOpts{concordance=TRUE} from the Rnw file, which was put in my Rnw file by Rstudio when Preference -> Sweave -> "Always enable Rnw concordance (required for syntex)" was checked. I had to uncheck that option. The error is gone. But I still have problem to compile PDF file with some warnings. I will try to figure it out later. [Update 4/13/13]: The problem is knitr generated two figure PDFs for one code chunk. And the first PDF has no page, which causes the following error: !pdfTeX error: /usr/texbin/pdflatex (file ./figure/minim –  user28957 Apr 13 '13 at 2:07
    
Thanks Yihui. It works with R 3.0 now. –  Hong Apr 16 '13 at 14:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.