Box to appear fully around equation

Add a phantom.

\documentclass{article}
\usepackage{mathtools}
\usepackage{unicode-math}

\begin{document}

\fbox{
$
  \zeta\nearrow
  \underset
     {\mathrlap{\displaystyle\Searrow\text{ overshoot}\searrow}}
     {\mathrlap{\Rightarrow\text{P.M.} \nearrow}}
\hphantom{\Searrow\text{ overshoot}\searrow}$
}
\end{document}

enter image description here


The problem is due to the use of \mathrlap. Here is another approach, based on the eqparbox package and a simple \boxed command:

\documentclass{article}
\usepackage{mathtools}
\usepackage{unicode-math}
\usepackage{eqparbox}
\newcommand{\eqlmathbox}[2][M]{\eqmakebox[#1][l]{$\displaystyle#2$}}

\begin{document}

$ \boxed{%
 \zeta\nearrow \underset {\eqlmathbox{\displaystyle\Searrow\text{ overshoot}\searrow}}%
     {\eqlmathbox{\Rightarrow\text{P.M.} \nearrow}}
}$

\end{document} 

enter image description here

Tags:

Box

Equations