Re: mathtools: \Aboxed



Le 11/06/2011 21:10, GL a écrit :
Le 11/06/2011 20:11, GL a écrit :

However considering that 2 consecutive cells are built there is no
need for any global assignment : everything can be done locally,
and with a greater simplicity :

\newcommand\Aboxed[1]{\let\bgroup{\romannumeral-`}\@Aboxed#1\ENDDNE}
\def\@Aboxed#1&#2\ENDDNE{\ifnum0=`{}\fi
\settowidth\@tempdima{$\displaystyle#1{}\m@th$}%
\advance\@tempdima \fboxsep \advance\@tempdima \fboxrule
\edef\mathtools@temp {% % < or \@tempa *local*>
\kern \@tempdima &\kern -\the\@tempdima
\fboxsep \the\fboxsep
\fboxrule \the\fboxrule
}\mathtools@temp \boxed {#1#2}%
}


Isn't it cleaner after all ?

And the more concise code is often the cleaner :

\newcommand\Aboxed[1]{\let\bgroup{\romannumeral-`}\@Aboxed#1\ENDDNE}
\def\@Aboxed#1&#2\ENDDNE{\ifnum0=`{}\fi \setbox \z@
\hbox{$\displaystyle#1{}\m@th$\kern\fboxsep \kern\fboxrule }%
\edef\@tempa {\kern \wd\z@ &\kern -\the\wd\z@ \fboxsep
\the\fboxsep \fboxrule \the\fboxrule }\@tempa \boxed {#1#2}%
}

6 magic lines !



Regards.

.



Relevant Pages

  • Re: Solar power battery system for WRT54GS
    ... supply is a 5V switch-mode wallwart. ... For simplicity, I built my ... portable device to run from 6 C cell nicads, ... voltage regulator that I built using a Texas Instruments chip. ...
    (alt.internet.wireless)
  • Re: mathtools: Aboxed
    ... need for any global assignment: ... and with a greater simplicity: ... memoir and mh bundle maintainer ...
    (comp.text.tex)
  • Re: i want a new good snow blower
    ... or a toro or simplicity, i just want to no y no one likes troy built. ... i also want to no what snow blowers will last long besides airens. ...
    (alt.home.repair)
  • Re: i want a new good snow blower
    ... or a toro or simplicity, i just want to no y no one likes troy built. ...
    (alt.home.repair)
  • Re: i want a new good snow blower
    ... or a toro or simplicity, i just want to no y no one likes troy built. ...
    (alt.home.repair)