I tried to reimplement some kind of a toc facility. I write wout
s argument into a file and try to reinclude this. So the Problem is, that \ior_str_gto:NN
seems to stop at linebreaks. Please consider the following example:
\documentclass{report}
\usepackage[latin1]{inputenc}
\usepackage{ expl3, l3keys2e, xfrac, xparse}
\ExplSyntaxOn
\iow_new:N\iow_out
\ior_new:N\ior_out
\file_if_exist:nTF {myout.out} {
\ior_open:Nn\ior_out{myout.out}
\ior_str_gto:NN\ior_out\tl_get_out
\ior_close:N\ior_out }
{ \typeout{no file! rerun}
}
\iow_open:Nn\iow_out{myout.out}
\DeclareDocumentCommand\wout { m } {
\iow_now:Nx\iow_out{#1}
}
\DeclareDocumentCommand\rout { } {
\tl_use:N\tl_get_out
}
\ExplSyntaxOff
%
%
\begin{document}
\wout{bla}
\wout{blub}
\rout
\end{document}
The Question is: How can i make \ior_to_gstr
to read in the whole file?
and: is there a better way to implement such a function using l3?
\ior_to:Nn
, etc. read one line at a time. If you look at LaTeX2e, the TOC concept is implemented by\input
ing the entire file. We have some experimental stuff for doing whole file loops, but not yet anything 'release ready'. Perhaps suggest what might work for you!