[texhax] plain TeX: separate itmes by comme in \write environment

Philip Taylor (RHUoL) P.Taylor at Rhul.Ac.Uk
Wed Apr 25 17:53:30 CEST 2018


OK, here's a different approach :


\newwrite \standout
\openout \standout = temp.txt

\def \write #1#2%
     {%
         \if \relax \the \toks 0 \relax
             \toks 0 = {#2}%
         \else
             \toks 0 = \expandafter {\the \toks 0 , #2}%
         \fi
     }
\def \donewriting #1{\primitive \write #1 {\the \toks 0 }\closeout #1}

\write \standout {Now}
\write \standout {is}
\write \standout {the}
\write \standout {time}
\write \standout {etc.}

\donewriting \standout
\leavevmode \vfill \eject
\input temp.txt

\end


More information about the texhax mailing list