[texhax] What's the problem? ( \input vs. token list )

ky anh xkyanh at yahoo.com
Sat May 17 03:26:26 CEST 2003


Please see message
   [texhax] \input vs. token list
     %% abstract: put file contents in a token list.
for more details.

--------------------------------------
<cvr at river-valley.org> wrote
  \makeatletter
  \def\multinput#1#2{\@tempcnta=0
    \loop\ifnum\@tempcnta<#1\input{#2}
                      | ^-- call "\input" 10 times
    \advance\@tempcnta1\repeat}
  \makeatother
--------------------------------------
<henkel at vh-s.de>      |
  \newtoks\xxx        |
  \xxx={\input yyy}   | <-- "\the\xxx" is not the
  \the\xxx            |     content of "foo.tex"
  \the\xxx            | <-- recall "\input"
--------------------------------------
Thank you very much!!!
--------------------------------------
BUT...
  We want to excute "\input foo.tex"
  just one time (only one), then put the contents
  of "foo.tex" in "\mytoks" (without excuting
  anything saved in "foo.tex").
THEN...
  any time and any where, we can use "\the\mytoks"...
EXAMPLES
  1. foo.tex -> \def\xxx{123} \def\yyy{345} \endinput
  2. After "\MyCMD foo.tex", then
     \mytoks -> {\def\xxx{123} \def\yyy{345}}
NOTE THAT...
  In two solutions (see above), we excute "\input"
  10 times. If "foo.tex" is big, then YOU MUST WAIT
  FOR A LONG TIME BEFORE TeX FINISH HIS EATING.
BLA BLA BLA....
--------------------------------------
Thank you for your reading and your new solutions!!!





__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com


More information about the texhax mailing list