I don't want to use knitr-chunks directly in my global tex-file. This file has of course \documentclass \begin{document} etc.
I want to do the knitr-stuff on sub-files and include the knitr-generatet tex-files then with \input into my global tex-file. This make it easier for me to manage and control my code.
<<example.Rnw>>
x <- 7
x
@
Running knitr() on this produces code that can not be build with xelatex.
I know from examples that knitr() normaly add a lot of new definitions between \documentclass and \begin{document}.
How could I handle this an elegant way with my sub-tex files?
Of course a workaround could be just to copy the relevant code in the header to my global document. But I don't know if this code would changed by knitr() depending on the code-chunk.