Am 06.05.2011 um 16:50 schrieb Mojca Miklavec:
> Hello,
>
> This is probably a very trivial question, but I'm not sure how TeX
> works in that respect. I'm used to use a macro
> \def\unit#1{{\rm\ #1}
> in constructs such as $1\unit{cm^2} \times 2\unit{cm}$. However I
> figured out that the contents of \unit{} cannot be broken accross
> lines, most probably because this becomes an hbox.
>
> Is there any simple workaround?
\def\unit{\groupedcommand{\rm\ }{}}
or
\def\unit#1{\bgroup\rm\ #1\egroup}
{ and } are same as \begingroup and \endgroup in math mode and prevent and a
line break of the content.
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________