[texhax] fbox in align environment

Sebastian Canagaratna s-canagaratna at onu.edu
Thu Jun 18 03:42:46 CEST 2009


Krishnan:

    Thank you very much. It works beautifully. I changed fboxsep and the
alignment is maintained. And, it works with pdflatex.

Sebastian

On Wed, Jun 17, 2009 at 11:45:35PM +0530, E. Krishnan wrote:
> 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