[texhax] fbox in align environment

Philip G. Ratcliffe philip.ratcliffe at fastwebnet.it
Wed Jun 17 16:13:59 CEST 2009


Here's a more self-contained version, which should handling alignmnet better
and allows for changing of \fboxsep via \alignboxedsep:

\documentclass{article}
\usepackage{amsmath}
\def\alignboxed#1&#2\endalignboxed{%
  \bgroup
  \fboxsep=\alignboxedsep
  \rlap{\boxed{#1#2}}\hphantom{#1\kern\fboxsep}
  \egroup
}
\newlength{\alignboxedsep}
\alignboxedsep=1pt
\begin{document}
\begin{align}
  f_1(x) &= a+bx,
\\
  \alignboxed
  f_2(x) &= a+bx+cx²,
  \endalignboxed
\\
  \alignboxed
  f_3(x) &= a+bx+cx²+dx³.
  \endalignboxed
\end{align}
\begin{align*}
  x+y+2    & = 1
\\
  2x+3y-4z & = 2
\\
  \alignboxed
  3x-2y+z  & =3
  \endalignboxed
\\
  \alignboxed
  a & = b+c+d
  \endalignboxed
\end{align*}
\end{document}

Cheers,  Phil



More information about the texhax mailing list