Print

Print


  This relates to stuff discussed earlier in this group, on how to make TeX
backtrack, in order to enable LaTeX to do certain things, like typesetting
certain music scores, producing helpfiles and reading those in one run,
etc.

  One way to do this backracking, is having TeX inputing the file needed to
be worked several times, but I want to point out that it is possible having
the file itself doing that input:

  With the code (put in the file named "thisfile.tex", typeset in PlainTeX)

\def\inputonce#1 {%
  \expandafter\ifx\csname #1/read\endcsname\relax%
    \expandafter\def\csname #1/read\endcsname{true}%
    \input #1 %
  \else%
    \relax%
  \fi}

\inputonce thisfile.tex

Test Text.

\def\endbacktrack{%
  \ifx\endit\undefined%
    \let\endit\relax%
    \endinput%
  \else%
    \relax%
  \fi}%

\endbacktrack

More stuff.

\end

The "Test Text" is typeset exactly twice, whereas the "More stuff" is
typeset once.

-- It looks as though that one might fiddle around with this idea, to
produce more controlled forms of back-tracking.

  Hans Aberg