[texhax] Creating stared versions of macros

Lars Madsen daleif at imf.au.dk
Thu Dec 30 11:30:20 CET 2004


Stefan Björk :

> How do I create two versions of a macro (\macro and \macro*) which is 
> very common in LaTeX?
>
> Stefan (who tried RTFM first)
>

\newcommand\foo{\@ifstar{\foos}{\foonos}}

then define \foos (stared version) and \foonos (unstared) as usual.

note that it \foo it to take say one argument then it's \foos and \foonos 
that has to take an argument not \foo

instead of RTFM -- try to look inside your favorite packages or clases


-- 

/daleif

``You cannot help men permanently by doing for them 
what they could and should do for themselves. ''
  -- Abraham Lincoln


More information about the texhax mailing list