[texhax] Obsolete \centerline command used in amsbook class (Uwe L?ck)

Reinhard Kotucha reinhard.kotucha at web.de
Mon Sep 24 23:56:11 CEST 2012

On 2012-09-24 at 13:25:08 -0400, Michael Barr wrote:

 > I couldn't agree more.  I suppose that, for some values of
 > "undefine", amslatex doesn't undefine \over.  I mistakenly thought
 > it did since I got the error: \over undefined control sequence.
 > Eventually, by tracking down the definition of \frac, I did find
 > \@@over.  Yes, it never occurred to me to first let \let\OVER\over
 > before loading the file and then \let\over\OVER after.  It is a
 > useful suggestion actually.
 > If Latex3 really disallows things it doesn't like, I am afraid the
 > tex community will fork and one branch (perhaps a very small
 > branch) will not adopt it.  Is that what the implementers want.

No.  Their aim is a _consistent_ programming interface for macro
writers which doesn't borrow constucts from other languages.

I assume that LaTeX2e will still be present in the future because
LaTeX3 will not be fully downward compatible.  The reason is that
LaTeX2e already inherited a few design flaws from LaTeX2.09 which 
are currently fixed by extra packages. 

 > I get intimations that they are seriously thinking of disallowing
 > \def and \let.

They will certainly pertain the _functuality_ of \def and its
variants.  Please run

  texdoc expl3

and read section 3.2.5 (Functions: argument specifications).

Simply removing \def without providing a replacement isn't possible

I don't know whether they intend to touch \let at all.  ATM I can't
imagine any good reason.

 > As I just explained to Uwe Lueck, I cannot imagine doing my diagram
 > macros (a front end to xypic) using \newcommand.  It has one macro,
 > \cube, that has 20 required and 32 optional parameters that are
 > delimited in various ways (look at it if you are interested).  I
 > suppose you could use Keyval, but I wouldn't want to.  The reason
 > for a total of 52 parameters is that a cube has has 8 vertices and
 > 12 arrows.  There are four parameters each for the inner and outer
 > squares, two for the placement and two for the hsize and vsize.
 > Each arrow requires three parameters, one for its shape and
 > direction, one for the label placement and one for the actual
 > label.

Well, I think \newcommand is a user level command and not sufficient
for package or class writers.  It's quite useful to extend the logical
markup at user level, for instance


Regarding \cube, you could also run

  texdoc xparse

At a first glance it seems that it doesn't support arbitrary
delimiters.  Maybe it's useful in combination with \def though and
could make your code more concise.  Writing a parser with \def which
has to handle optional arguments is not overly difficult.  But it's
always a lot of manual work.  When I played with xparse about twelve
years ago I was quite amazed how much time it saved me.

Let me summarize: The subject of this thread is \centerline, not \def.
l2tabu is correct, the problem is that amslatex doesn't follow LaTeX
conventions for internal macros (\centerline instead of \@centerline).

Both, \centerline and \over are not supported by LaTeX.  For example,
boxes in LaTeX support color, plain TeX boxes don't (consult the LaTeX
kernel code).  Even if non-LaTeX control sequences seem to work, you
might be surprised later.  Therefore they are deprecated.

\def is very dangerous because it silently overwrites existing macros.
This is fine if you're using plain TeX because you have the TeXbook at
hand and know which macros you wrote yourself.  But LaTeX is modular.
Just include another package and nothing is as it had been before.
And you don't even get a comprehensible error message.  \newcommand at
least tries to report the error where it occurs.  Sure, \def is
unavoidable if you need a powerful argument parser.  It should only be
used by people who exactly know what they are doing, and not because
\def is more convenient to type than \newcommand.

It's a matter of fact that LaTeX2e has several deficiencies.  It
inherited some design flaws from 2.09 for the sake of backward
compatibility, didn't remove obsolete (unsupported) control sequences,
and didn't replace all critical control sequences by its own.  But
LaTeX2e never claimed to be perfect.  Its purpose was to fix the most
significant flaws in 2.09.  The developers always concentrated on
LaTeX3.  This will be the "real thing".  I'm looking forward!


Reinhard Kotucha                                      Phone: +49-511-3373112
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