LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Hans Aberg <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 7 Mar 1997 13:47:37 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (45 lines)
  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

ATOM RSS1 RSS2