[texhax] \newcommand

Ian Collier imc at comlab.ox.ac.uk
Thu Sep 25 23:12:52 CEST 2003


rmason at sparky2.esd.mun.ca (Roger Mason) writes:
>I am trying to define a command in latex with this code in the preamble:

>\newcommand{\mybox}[2]{%
>  \setlength{\unitlength}{1pt}
>  \makeatletter
>  \begin{picture}(\strip at pt\linewidth,#1)
>    \put(0,0){\framebox(\strip at pt\linewidth,#1)[tl]{#2}}
>  \end{picture}
>  \makeatother}

\makeatletter and \makeatother affect what happens when the definition
is read in, not when the definition is executed - so you should put
them at the top level, before and after your definition.
-- 
---- Ian Collier : imc at comlab.ox.ac.uk : WWW page below
------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml


More information about the texhax mailing list