1
votes

I'm writing a book in R Sweave, as long as the document is becoming larger I use the \include LaTeX command to include files. When I PDF-Compile the main file the files with R chunks are not included. What extension they must have .tex or .Rnw?

1
I think .tex but I could be wrong. You might have better luck on the TeX SE site.Alex A.
You can also take a look at how knitr handles child documents. It offers somewhat more flexible interface for these kinds of complex projects compared to Sweave.Thomas

1 Answers

1
votes

From the Sweave User Manual, p. 7

Latex files can include others via \input{} commands. These can also be used in Sweave files, but the included files will be included by Latex and are not processed by Sweave. The equivalent if you want the included files to be processed is the \SweaveInput{} command. Included files should use the same Sweave syntax (see below) and encoding as the main file.