I have noticed that I get errors when trying to box an entire equation in the align environment. I get similar errors if I try to put the entire equation inside big parenthesis using \left(
and \right)
.
I know that the error is stemming from the fact that the alignment marker &
is inside these equations (I am using the align environment after all). A possible workaround for the parenthesis case would be to use \Big(
and \Big)
. I'm afraid that doesn't help if I want to box the entire equation.
Another alternative is to stick a separate environment like \begin{equation}\end{equation}
where I need the boxed equation but if it is in the middle of an align environment then I have just split my align environment with no way to maintain the alignment marker position.
Does anyone have any experience with this error they'd like to share? Any other workarounds for the case of boxing an entire equation with an alignment marker?
Related to the MWE below, I am trying to box the entire definition of f_{ij}
including the left hand side and equal sign. Error occurs because of the &
at the first equal sign.
MWE
\documentclass[11pt,letterpaper]{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
a &= b + c\\
d_{ij} &= e + f_{ij}\\
\boxed{f_{ij} &= \begin{cases} % I want to box this entire equation
1 & \text{if} \quad i = j\\
0 & \text{if} \quad i \neq j\\
\end{cases}}\\
d_{ii} &= e + f_{ii} = e + 1
\end{align*}
\end{document}
cases
.\boxed{}
around the entire equation.\Aboxed{}
from themathtools
package but that does not appear to work either.\left( ... \right)
(with or withoutcases
). But I guess that's not what you meant.