I was just trying to do this and I think I have a reasonable solution that seems to be working well.
In the main document you can include a chunk with a logical section: <<optnsa, echo=F, results=tex>>= if(T){ {sink("/dev/null"); Sweave(’subsection.Rnw'); sink(); } cat('\\input{subsection.tex}') } @ Then you can put your subsection logic into subsection.Rnw, just make sure to remove all of the default latex header stuff, just put in the blocks that you want to process: This comes from a subsection. <<ssb1>>= cat(”I’m in a subsection”) @ This worked for me Kyle ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.