NoobixCube
- 154
- 0
How do you put a box around a numbered equation?
The discussion centers around how to put a box around a numbered equation in LaTeX, exploring different methods and commands available in the amsmath package. The scope includes technical explanations and practical applications for formatting equations in documents.
Participants generally agree on the methods presented for boxing equations, but there is no explicit consensus on a single best approach, as different methods are provided for different preferences.
Limitations include the need for careful attention to spacing in LaTeX commands and the potential for misalignment if commands are modified without proper adjustments.
NoobixCube said:How do you put a box around a numbered equation?
\documentclass{article}
\usepackage{amsmath}
\begin{document}
some text
\begin{equation}
\boxed{
x^2+y^2 = z^2
}
\end{equation}
more text
\end{document}
\documentclass{article}
\newcommand{\boxeqn}[1]{
\[
\fbox{
\addtolength{\linewidth}{-2\fboxsep}%
\addtolength{\linewidth}{-2\fboxrule}%
\begin{minipage}{\linewidth}
\begin{equation}
#1
\end{equation}
\end{minipage}
}
\]
}
\begin{document}
some text
\begin{equation}
x^2 + y^2 = z^2
\end{equation}
more text
\boxeqn{
a^2 + b^2 = c^2
}
more text
\boxeqn{
\oint \vec B\cdot d\vec A =0
}
\end{document}