4

I have the following; however I want to add more space between the formula and the underbrackets so that it doesn't look so squished. How can I do that?

\documentclass[a4paper]{article}   
\usepackage{mathtools}
\begin{document}
   \begin{equation}\label{eq:reprojection_error_final}
        f=\min_{\hat{P}^i, \hat{X}_j}
        \sum_{ij} \Bigl[\underbracket[1.5pt][8pt]{d(\hat{P}^i \hat{X}_j, x^i_j)}_{\text{Projektionsdiff.}} + \underbracket[1.5pt][8pt]{d(L_k^m - L_{k+1}^m ,\hat{X}_k^m - \hat{X}_{k+1}^m)}_{\text{3D-Punkt-Differenz}} + \underbracket[1.5pt][8pt]{d(\hat{X}_0, 0)}_{\text{Ursprungsdiff.}}\Bigr]^2
        \end{equation}
\end{document}

Current result: enter image description here

John
  • 43

2 Answers2

5

You can use the bigstrut package: \bigstrut[b] adds avertical distance below the insertion point, and this distance is controlled by the value of \bigstrutjot:

\documentclass[a4paper]{article}
\usepackage{mathtools}
\usepackage{bigstrut}

\begin{document}

\begin{equation}\label{eq:reprojection_error_final}
    f=\min_{\hat{P}^i, \hat{X}_j}
    \sum_{ij} \Bigl[\underbracket[1.5pt][8pt]{\bigstrut[b]d(\hat{P}^i \hat{X}_j, x^i_j)}_{\text{Projektionsdiff.}} + \underbracket[1.5pt][8pt]{\bigstrut[b]d(L_k^m - L_{k+1}^m ,\hat{X}_k^m - \hat{X}_{k+1}^m)}_{\text{3D-Punkt-Differenz}} + \underbracket[1.5pt][8pt]{\bigstrut[b]d(\hat{X}_0, 0)}_{\text{\clap{Ursprungsdiff.}}}\Bigr]^2
\end{equation}

\begin{equation}\label{eq:reprojection_error_final}
\setlength{\bigstrutjot}{1.5ex}
    f=\min_{\hat{P}^i, \hat{X}_j}
    \sum_{ij} \Bigl[\underbracket[1.5pt][8pt]{\bigstrut[b]d(\hat{P}^i \hat{X}_j, x^i_j)}_{\text{Projektionsdiff.}} + \underbracket[1.5pt][8pt]{\bigstrut[b]d(L_k^m - L_{k+1}^m ,\hat{X}_k^m - \hat{X}_{k+1}^m)}_{\text{3D-Punkt-Differenz}} + \underbracket[1.5pt][8pt]{\bigstrut[b]d(\hat{X}_0, 0)}_{\text{\clap{Ursprungsdiff.}}}\Bigr]^2
\end{equation}

\end{document} 

enter image description here

Bernard
  • 271,350
4

Also check out \vphantom

\documentclass[a4paper]{article}   
\usepackage{mathtools}
\begin{document}
   \begin{equation}\label{eq:reprojection_error_final}
        f=\min_{\hat{P}^i, \hat{X}_j}
        \sum_{ij} \Bigl[\underbracket[1.5pt][8pt]{d_{\strut}(\hat{P}^i \hat{X}_j, x^i_j)}_{\text{Projektionsdiff.}} + \underbracket[1.5pt][8pt]{d_{\strut}(L_k^m - L_{k+1}^m ,\hat{X}_k^m - \hat{X}_{k+1}^m)}_{\text{3D-Punkt-Differenz}} + \underbracket[1.5pt][8pt]{d_{\strut}(\hat{X}_0, 0)}_{\text{Ursprungsdiff.}}\Bigr]^2
        \end{equation}
\end{document}
JPi
  • 13,595