[texhax] the \let command

Uwe Lück uwe.lueck at web.de
Wed Nov 29 00:07:45 CET 2006


Hi -- \let me comment (perhaps improving) a number of contributions
to the thread as follows:

At 14:56 27.11.06, tom sgouros wrote:

>A lot of unnecessary fog was generated here by assuming the question is
>a common one.  But the following:
>
>\let\tie\t
>\def\t{t}
>\let\mycedilla\c
>\def\c{c}
>
>\t bb
>\tie bb
>\c b
>\mycedilla b
>
>\end
>
>Works as you'd expect in plain TeX.  But this does not work:
>
>\documentclass{article}
>\begin{document}
>
>\let\tie\t
>\def\t{t}
>\let\mycedilla\c
>\def\c{c}
>
>\t bb
>\tie bb
>\c b
>\mycedilla b
>
>\end{document}
>
>You'll see that the only difference is LaTeX.  This is not an issue of
>someone misunderstanding or forgetting the meaning of \let (like I do
>all the time), but of something that works in TeX and doesn't work in
>LaTeX.  Any explanations would be welcome in this quarter, too.

At 19:39 27.11.06, Oleg Katsitadze wrote:
>On Mon, Nov 27, 2006 at 12:49:25PM -0500, tom sgouros wrote:
> > Is this LaTeX or TeX?
>
>It's TeX inside LaTeX :).  Seriously, as far as (primitive) TeX is
>concerned, there's only \font, everything else is LaTeX (or plain TeX,
>or whatever).

The different behaviours of \t are not due to a difference
between LaTeX and TeX, but between LaTeX and Plain TeX.
See TeXbook p. 356 bottom. Both \c and \t are rather simple
things there, as compared with their LaTeX versions:

At 23:54 27.11.06, Disgusted of Tunbridge Wells wrote:

>tom sgouros wrote:
>
> > -- why does \t work differently than \c in the document posted?
>
>In a word : "dunno" :-((( But looking at \tracingall when
>\tie bb and \mycedilla b are executed indicates that the
>former is /considerably/ more complex than the latter.

As usual,

     {\tracingmacros=1 \t bb}

avoids much \tracingall fog. Even better:

     {\t bb \tracingmacros=1 \t bb \c b}

avoids logging font initialisation.

You see differences between \OML-cmd and \OT1-cmd
and how they differ from the Plain TeX versions.

You see that \c and \t expand to something containing
\c and \t again (has this been meant with "recursive"?).

However, \c uses "itself" only for the \@inmathwarn.
Already here, I think, a property (or failure) of \let plays a role.
Example:

     \let\mycedilla\c $\mycedilla b$

This produces a warning about some \c in math mode,
although there is \mycedilla, not \c, in math mode. Moral:

     \let\mycedilla\c

stores the expansion (the \meaning!) of \c,
it doesn't replace occurrences of \c by \mycedilla -- cf.:

At 21:48 27.11.06, Reinhard Kotucha wrote:

>\protect behaves similar.

At least, the \@inmathwarn uses \protect indeed.
But Reinhard certainly also thinks of what happens
when \protect "releases" its argument, i.e.: allows
its expansion/evaluation (instead of just producing
another \protect\foo) ...

When \mycedilla (or \c) has passed the math check,
it indeed expands almost like the Plain TeX version of \c.
This is different to \t and \OML-cmd ... \t calls
\UseTextAccent, unlike \c ... I must stop further
investigations  here ...

A question of _mine_ is why

    \DeclareTextAccent{\tie}{OML}{127}

doesn't work -- i.e.: \t eventually uses \OT1\t successfully
-- where from is this? -- while \OT1\tie gives an error
(on trying to use \tie). -- Well, adding

     \expandafter\csname OT1\string\tie \endcsname{%
       \UseTextAccent{OML}\tie}

works.

-- Thanks to all of you for this thrilling discussion!

My next posting offers some solutions to the original
question of switching between versions of \c or \t etc.

-- Uwe.



More information about the texhax mailing list