[texhax] \def vs. LaTeX (was: Obsolete \centerline ... amsbook)

Uwe Lück uwe.lueck at web.de
Mon Sep 24 14:54:20 CEST 2012


Am Sonntag, den 23.09.2012, 13:36 -0400 schrieb Michael Barr: 
> 
>                             As for the use of \def, well if there were 
> a procedure that had all the funcionality of \def and just gave a warning 
> instead of stopping on error when you had redefined something, I would 
> gladly use it.

I still wonder whether you need \def for delimited parameters. 
If so, you may like redefine.tex,

    http://ctan.org/pkg/redefine

(light-weight) or the rather heavy ltxnew:

    http://ctan.org/pkg/ltxnew

Otherwise, what about LaTeX's \DeclareRobustCommand?

redefine.tex actually redefines \newcommand, indirectly, 
turns \@notdefinable into a warning. If this is a 
problem for some of the readers, I would suggest storing 
LaTeX's \@notdefinable and restoring it after loading 
redefine.tex optionally.

The documentation of redefine.tex is not very explicit. 
Just on reading its code I believe that it provides 
"warning only" commands \newdef, \newgdef, and \newlet.

Am Sonntag, den 23.09.2012, 13:36 -0400 schrieb Michael Barr: 
> 
> I certainly agree that redefining \newcommand is shoddy and I would never 
> do that.

Cheers,

    Uwe.





More information about the texhax mailing list