A script that has been running smoothly for a month has stopped adding my child latex code to my main document after upgrading to version 3.0. The following snippet is used to include text from a compiled test.rnw file in my main document (so that it can be compiled as a single document). Now it just includes the file names of the compiled rnw files.
<<run-all, include=FALSE>>= out = NULL for (i in 1:10) { out = c(out, knit_child('test.rnw', sprintf('test-template-%d.tex', i))) } @ \Sexpr{paste(out, collapse = '\n')}
When I try to run the knit_child command interactively, I get this error:
> knit_child('test.rnw', sprintf('test-template-%d.tex', i)) Error in setwd(opts_knit$get("output.dir")) : character argument expected
Only Running knit () will compile the Latex code, if I run knin_child (), there is no error, but the "out" object simply contains the file name of the child file instead of the contents.
Any ideas how to fix this?
source share