The following example makes a huge box that's the full width of the text, including the equation number:
\begin{framed}
\begin{equation}
x=y
\end{equation}
\end{framed}
Is there a way to get a box just around the equation itself?
Best is to use boxed
from amsmath
.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Using \verb|boxed| from \verb|amsmath|:
\begin{equation}
\boxed{x=y}
\end{equation}
Using \verb|fbox|:
\begin{equation}
\fbox{$x=y$}
\end{equation}
\end{document}
If you use align
and friends from amsamth
, you are better off with Aboxed
from mathtools
package. A relevant and useful reference will be This question and its answers.