3

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?

5

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}

enter image description here

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.