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

Rodolfo Medina rodolfo.medina at gmail.com
Wed Apr 25 17:58:29 CEST 2018


"Philip Taylor (RHUoL)" <P.Taylor at Rhul.Ac.Uk> writes:

> 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


Thanks...  I'm afraid the `\primitive' command is not in my TeX box...

Rodolfo



More information about the texhax mailing list