[texhax] [TeXhax] Latex: dumbing down ?

Reinhard Kotucha reinhard.kotucha at web.de
Sun Sep 3 05:37:17 CEST 2006


>>>>> "Philip" == Philip TAYLOR <P.Taylor at Rhul.Ac.Uk> writes:

  > and Reinhard Kotucha wrote :

  >> There are two points:
  >> 
  >> 1.  It is pretty counterproductive to try to convince a LaTeX
  >> user who almost finished his work and has a question about a
  >> minor formatting detail to throw away everything and start from
  >> scratch using plain TeX.

  > In complete agreement.

It would be nice if John can agree too.

  >> 2.  Even worse, convincing people to insert plain TeX code into
  >> LaTeX files is misleading.  It simply doesn't work.  Did you look
  >> at the definition of \@ifundefined?

  > It /does/ work, if you know what you are doing (I know no other
  > way of using LaTeX); and no, I don't recall ever looking into the
  > innards of \@undefined, but I /do/ look into the innards of
  > anything/everything I need to hack, and then base my Initex or
  > Plain TeX additions on what I have learned.

Let me explain why I think that LateX and plain tex cannot be
combined and why I use \@ifundefined as an example.

The definition of \@ifundefined is

    \expandafter \ifx \csname #1\endcsname \relax \expandafter
    \@firstoftwo \else \expandafter \@secondoftwo \fi

Hence, if someone says \@ifundefined{foo}{}{} and tries later
\ifx\foo\undefined this will always succeed because \@ifundefined sets
undefined cotrol sequences to \relax.  

You cannot safely use \ifx in LaTeX.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------




More information about the texhax mailing list