I have the following code:
\framebox{
\begin{align*}
Something here
\end{align*}
}
which gives the following errors:
- Missing
\endgroup
inserted - Missing
}
inserted - LaTeX Error:
\begin{document}
ended by\end{align*}
- Missing
$
inserted - Display math should end with
$$
- Extra
\endgroup
- Too many
}
s
I'm new to Latex and don't understand why this is happening. Is this a Latex bug? How can I put an equation inside a box?
Best Answer
Not a bug, user error.
\framebox
is like\mbox
and is a single line (horizontal mode) construct,align
is a display construct that needs to be in vertical mode. There are several packages for boxed vertical material: mdframed and tcolorbox for example, or simply use