I'm trying to use newfile.sty and find myself unable to define a macro that contains the writeverbatim environment.
For example, LaTeX works fine on this file:
\documentclass[12pt]{report}
\usepackage{newfile}
\newoutputstream{charax}
\openoutputfile{\jobname.drp}{charax}
\begin{writeverbatim}{charax}
A
\end{writeverbatim}
\closeoutputstream{charax}
\begin{document}
\input{\jobname.drp}
\end{document}
But if I enclose the writeverbatim environment within a macro, LaTeX fails with the message
Runaway argument?
! File ended while scanning use of \next.
Here's the packaged version:
\documentclass[12pt]{report}
\usepackage{newfile}
\newoutputstream{charax}
\openoutputfile{\jobname.drp}{charax}
\newcommand{\Fee}{
\begin{writeverbatim}{charax}
A
\end{writeverbatim}
}
\Fee
\closeoutputstream{charax}
\begin{document}
\input{\jobname.drp}
\end{document}
In case it's relevant, I'm using MiKTeX 2.7. I haven't been able to find anything about this on the web. Any help would be appreciated.
--
David Guaspari
General ⇒ Problem with newfile.sty: using writeverbatim in a macro
Problem with newfile.sty: using writeverbatim in a macro
This is the traditional "verbatim within another
command" problem (see http://www.tex.ac.uk/cgi-bin/texfaq2htm ... verbwithin)
parameter-derived text and so may just as well appear
outwith a macro; what in fact are you aiming to achieve?
command" problem (see http://www.tex.ac.uk/cgi-bin/texfaq2htm ... verbwithin)
looks like a simplified example, since it contains no\openoutputfile{\jobname.drp}{charax}
\begin{writeverbatim}{charax}
A
\end{writeverbatim}
\closeoutputstream{charax}
parameter-derived text and so may just as well appear
outwith a macro; what in fact are you aiming to achieve?