I'm trying to create an environment in latex that writes the lines that are between the \begin{environment} and \end{environment} verbatim in a TeX file.
I have tried the fancyvrb package, it works but if I specify several \begin{environment} in my source file, only the last lines are written to the outfile (I'm guessing that VerbatimOut recreates the outfile every time, and does not append to it).
Does anybody have a lead on this? Thanks!
This is a slightly indirect answer, but Victor Eijkhout's
comment
package does something similar, in the sense that it processes ‘verbatim’ blocks in the same way that LaTeX does. If that doesn't, then its implementation suggests how to do this by hand (that is, this package is what I copied when I had to this myself).Failing that, you might want to ask on the TeX Stackexchange site.