[texhax] \input vs. tokens list?

Radhakrishnan CV cvr at river-valley.org
Fri May 16 12:25:20 CEST 2003


>>>>> "ky" == ky anh <xkyanh at yahoo.com> writes:

    ky> In a same TeX job, I call "\input foo.tex" so many times
    ky> (about 10 times and more).  This will "slow down" the TeX and
    ky> system.

    ky> Can we use "\input foo.tex" only once, then put the content of
    ky> "foo.tex" in the token list \mytoks; then instead of reuse
    ky> \input, we can call \the\mytoks?

You might define a macro like:

\makeatletter
\def\multinput#1#2{\@tempcnta=0
  \loop\ifnum\@tempcnta<#1\input{#2}
   \advance\@tempcnta1\repeat}
\makeatother


In the document you might use:

 \multinput{10}{foo.tex}

foo.tex is input ten times.

Radhakrishnan




More information about the texhax mailing list