[texhax] How do you make * macros?

Uwe Lueck uwe.lueck at web.de
Fri Oct 22 16:41:03 CEST 2010

"Michael Barr" <barr at math.mcgill.ca>, 22.10.2010 15:37:24:
> Assuming I have a macro \xxx that does something, how do I make \xxx* that 
> does something slightly different?  If think I make something using 
> \@ifnextchar, but there is probably an "official" way of doing it that I 
> don't see in the Companion (1994 edition).

>From scratch: \let\unstarred at xxx\xxx, \def\xxx{\@ifstar\starred at xxx\unstarred at xxx} etc. 

More generally, \@ifstar expects two arguments, e.g., with braces. 

"Public" macros for making starred commands are provided by David Kastrup's suffix package:


HTH -- Uwe.

More information about the texhax mailing list