[texhax] fbox in align environment

E. Krishnan ekmath at asianetindia.com
Wed Jun 17 20:15:35 CEST 2009


On Wed, 17 Jun 2009, E. Krishnan wrote:

> On Tue, 16 Jun 2009, Sebastian Canagaratna wrote:
>
>> Can it be made to work directly with pdflatex?
>
> How about this?
>
>  \usepackage{calc}
>
>  \newlength{\eqwd}
>  \newlength{\eqht}
>  \newlength{\eqdp}
>  \newlength{\shift}
>
>  \newcommand{\mkeqbx}[1]{%
>  \settowidth{\eqwd}{$#1$}%
>  \settoheight{\eqht}{$#1$}%
>  \settodepth{\eqdp}{$#1$}%
>  \setlength{\shift}{\eqwd+3pt}
>  \hspace{-\shift}%
>  \framebox{\rule[-\eqdp]{0pt}{\eqht+\eqdp}\hphantom{$#1$}}}


It is slightly better to have

\newcommand{\mkeqbx}[1]{%
   \settowidth{\eqwd}{$#1$}%
   \settoheight{\eqht}{$#1$}%
   \settodepth{\eqdp}{$#1$}%
   \setlength{\shift}{-\eqwd-\fboxsep}   %%%%%%% default \fboxsep=3pt
   \hspace{\shift}%
   \framebox{\rule[-\eqdp]{0pt}{\eqht+\eqdp}\hphantom{$#1$}}}



-- 
Krishnan


More information about the texhax mailing list