Am 22.06.10 09:10, schrieb Hans Hagen:
On 21-6-2010 10:16, Wolfgang Schuster wrote:
\unexpanded\def\mbox
{\ifmmode\normalmbox\else\dontleavehmode\normalhbox\fi}
as i never use this command it won't break my documents -)
thanks, this looks good
in retrospect it's tricky ...
\setbox0\mbox{...}
will break then
at the cost of a box register even this works
\def\mbox
{\ifmmode\normalmbox\else\specialmbox\fi}
\newbox\textmbox
\def\specialmbox
{\normalhbox\bgroup
\dowithnextbox{\global\setbox\textmbox\box\nextbox\egroup\dontleavehmode\box\textmbox}\normalhbox}
\starttext
\hbox{text} text text
\mbox{text} text text
\setbox0\hbox{bar}\setbox1\mbox{foo}\box1\box0
\stoptext
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________