I have a LaTeX file for inclusion, automatically generated by a code-documentation tool, so the fact it’s a single file is non-negotiable. However, I want to include it not all at once, but some parts in one place, some in another — so I’d like to put some sort of delimiting information into the auxiliary file, perhaps giving labels to specific chunks, and then have a syntax for including the individual chunks as though there.
I’m imagining something the following: an auxiliary file quotations.tex looking something like:
\begin{chunk}{shakespeare}
\begin{quote}``To be or not to be?''\end{quote}
\end{chunk}
There might also be other content between the chunks, like this.
\begin{chunk}{pythagoras}
\[ x^2 + y^2 = z^2 \]
\end{chunk}
and then in the main file,
[preamble etc.]
Shakespeare wrote:
\includechunk{quotations.tex}{shakespeare}
Pythagoras proved:
\includechunk{quotations.tex}{pythagoras}
(In my actual document, the chunks are much longer than this — typically a page or two.) Is there a good way of doing something like this? The include file is generated by coqdoc, if that’s relevant.
catchfilebetweentagpackage. – Martin Scharrer Aug 15 '11 at 20:03