1

I have a file for my thesis, which include the chapters. A few weeks ago, I worked with R-Statistic and *.rnw files to produce a *.tex paper. Now, I want to include these *.tex paper in my thesis. However, every time I get several errors.

  1. Structure

    /home/UserName/R-files/Dokumentation5.rnw 
    
    /home/UserName/tex-Files/Dokumentation5.tex  // from Dokumentation5.rnw files
    
  2. In the following folder, I put the TeX and the figures (*.pdf).

    /home/UserName/Documentation/chapter/
    
  3. Edit the Dokumentation5.tex, remove the beginning and "end document"

  4. In thesis file, I added the following commands:

    \usepackage{Sweave}    \include /home/UserName/Documentation/chapter/
    
  5. run latex

If I run LaTeX, I got several errors like:

File `Dokumentation5-004' not found.

 \begin{document} ended by \end{Schunk}.

 Too many }'s

 File `Dokumentation5-033' not found.
Werner
  • 14,324
  • 7
  • 55
  • 77
rXhalogene
  • 13
  • 4

1 Answers1

2
  1. Create a file master.Rnw that contains nothing but the LaTeX setup (packages to be used, geometry, title, begin/end document, bibliography style and file......)
  2. If you need to use R functions in various places in your paper, create a file func.Rnw where you create these functions. Make this file the first to \SweaveInput{func.Rnw} in your master.Rnw - see here for details
  3. Now create one file for each "unit" of your paper (chapter, section, whatever you like). Make them all chapX.Rnw files, whether they contain R code or not.
  4. \SweaveInput{chapX.Rnw} them in the desired order in your master.Rnw file.
  5. At any time during the process, run Sweave("master.Rnw") in R and then pdflatex master.tex from the console to see what you have produced.
Community
  • 1
  • 1
vaettchen
  • 7,299
  • 22
  • 41
  • Hi, i created a master file and copied all style into this file. However there a some problems. First, Latex "says": to many "}". Second, if I include all *.rnw with \SweaveInput, Sweave("master.rnw") return the error: Error c("page.rnw", "master" is not ASCII and does not declare an encoding) – rXhalogene Jun 22 '13 at 18:28
  • If LaTeX says "Too many `}`", then there are probably too many `}`. Do you have an editor that highlights open and close `}`? You may need to go through each of your files and make sure that you only have matching pairs. For the encoding problem, try adding `\usepackage[utf8]{inputenc}`. Which language are you using? – vaettchen Jun 23 '13 at 09:43