knit
doesn't parse tex commands, so methods.tex
will not be read out at knit
ting-time.
For workaround, try this:
<<knitr, include=FALSE>>=
library(knitr)
opts_knit$set(self.contained=FALSE)
file.copy("methods.tex", "methods.rnw")
@
\documentclass{article}
\begin{document}
<<pre-results1, child='child.rnw', include=FALSE>>=
@
<<pre-results2>>=
source("codeB.R")
@
% Methods section from rnw file
<<child="methods.rnw">>=
@
\end{document}