Open LarsaSolidor opened 6 years ago
I'd be interested to know how to do this too. Initially I thought using \include{}
or \input{}
as is common in modular documents might work, but because Pweave is processing the document and its not being compiled from tex to PDF the child documents are .texw
they're not pulled in.
You can use the source chunk option: http://mpastell.com/pweave/chunks.html#envvar-source
Thanks for the pointer I'll give that a go.
Found time to give this a go and can't seem to specify child documents that are .texw
.
pweave_example.texw
\documentclass[hidelinks, 11pt]{article}
\geometry{a4paper,left=25mm, right=25mm, top=20mm, bottom=20mm}
\begin{document}
Lets try including a child document.
<<intro, eval=True, echo=False, results='tex', source='pweave_intro.texw'>>=
@
\end{document}
pweave_intro.texw \clearpage This is a child document.
After weaving this with...
pweave pweave_example.texw
...the resulting .tex
is...
\documentclass[hidelinks, 11pt]{article}
\geometry{a4paper,left=25mm, right=25mm, top=20mm, bottom=20mm}
\begin{document}
Lets try including a child document.
\textcolor{ansi-cyan}{ File }\textcolor{ansi-green}{"<ipython-input-1-7b7bb7cedd73>"}\textcolor{ansi-cyan}{, line }\textcolor{ansi-green}{1}
\textcolor{ansi-red}{ \clearpage}
^
\textcolor{ansi-red}{SyntaxError}\textcolor{ansi-red}{:} unexpected character after line continuation character
\end{document}
I'm still confused how to include child .texw
and have them parsed correctly.
In knitr, I can use the below pieces of code to break a document into seperate files:
Assignment_1.Rnw
In the directory I have these files
When I call knitr on Assignment_1.Rnw it combines all four files into one .tex document before passing it through latex to get the PDF.
Would it be possible to add similar functionality to Pweave?