2 Answers
Hackjob to get
First I print a boxed equation with horizontal space equivalent of the root, then print the root in box with white background on top.
\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\begin{document}
\[
\fboxsep=1pt\relax
\newcommand\MyRoot{{}= \sqrt{\frac{4\pi\delta}{\sigma_1\bigl((X+Y)(X-Y)\bigr)^{\sigma_2}}}}
\ooalign{%
$\displaystyle\boxed{\hat{g} \hphantom{\displaystyle\MyRoot} \approx 999.121}$\cr
\fboxsep=0pt\relax\hspace{0.8em}\colorbox{white}{$\displaystyle\MyRoot$}
}
\]
\end{document}
egreg suggests using \boxed
macro of the amsmath
package.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\fboxsep=1pt\relax
\boxed{\hat g} = \sqrt{\frac{4\pi\delta}{\sigma_1\bigl((X+Y)(X-Y)\bigr)^{\sigma_2}}}
\boxed{{}\approx 999.121}
\]
\end{document}
Without any packages, (i.e., with \fbox
):
\documentclass{article}
\begin{document}
\[
\fboxsep=1pt\relax
\fbox{$\hat g$} = \sqrt{\frac{4\pi\delta}{\sigma_1\bigl((X+Y)(X-Y)\bigr)^{\sigma_2}}}
\fbox{${}\approx 999.121$}
\]
\end{document}
FOLLOW UP
I did not originally perceive the 3-sided nature of the applied boxes in the OP's figure. That can be achieved using the current method, with the addition of a \clipbox
upon the \fbox
. It has been macroed as \boxl{}
and \boxr{}
:
\documentclass{article}
\usepackage{trimclip}
\newcommand\boxl[1]{\clipbox{0pt 0pt 1.4\fboxrule{} 0pt}{\fbox{$#1{}$}}}
\newcommand\boxr[1]{\clipbox{1.4\fboxrule{} 0pt 0pt 0pt}{\fbox{${}#1$}}}
\begin{document}
\[
\fboxsep=1pt\relax
\boxl{\hat g}
= \sqrt{\frac{4\pi\delta}{\sigma_1\bigl((X+Y)(X-Y)\bigr)^{\sigma_2}}}
\boxr{\approx 999.121}
\]
\end{document}
-
1