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.
4

1 回答 1

2
  1. 创建一个master.Rnw只包含 LaTeX 设置的文件(要使用的包、几何、标题、开始/结束文档、参考书目样式和文件......)
  2. 如果您需要在论文中的各个位置使用 R 函数,请创建一个文件func.Rnw来创建这些函数。将此文件设为\SweaveInput{func.Rnw}您的第一个文件 -有关详细信息,master.Rnw请参见此处
  3. 现在为论文的每个“单元”(章节、部分,任何你喜欢的)创建一个文件。使它们成为所有chapX.Rnw文件,无论它们是否包含 R 代码。
  4. \SweaveInput{chapX.Rnw}它们在您的master.Rnw文件中以所需的顺序。
  5. 在此过程中的任何时候,Sweave("master.Rnw")在 R 中运行,然后pdflatex master.tex从控制台查看您生成的内容。
于 2013-06-22T11:13:43.253 回答