# [texhax] \newcommand

Roger Mason rmason at sparky2.esd.mun.ca
Thu Sep 25 17:45:33 CEST 2003

Hello,

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}

It is designed to produce a box that is the width of the \linewidth
currently in use at height #1 containing text #2.  The code in the
definition was obtained from the archives of this list and runs fine when
embeded in a LaTeX document (with numbers for #1 & #2).  When I define the
command above and invoke it using (for example)

\mybox{72}{Zn}

in the body of the document, compilation fails and the log file says:

! Undefined control sequence.
<argument> \strip
@pt\linewidth
l.90 \mybox{72}{Zn}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., \hobx'), type I' and the correct
spelling (e.g., I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Is there some simple step I am missing?

Thanks for any replies,

Roger Mason

P.S. Is it considered good etiquette on this list to thank responders on
the list or should that be done privately?

`