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

  • 1
    Can you provide a Minimal Working Example? What are the packages that you use? – Sina Ahmadi Nov 9 at 13:54
  • @SinaAhmadi I edited the question; I'm using the mathtools package. – John Nov 9 at 14:10
  • MathToolspackage documentation does not mention anything regarding that distance. This is the only thing provided: \underbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉}and \overbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉}. – Sina Ahmadi Nov 9 at 14:12
  • Yes I know; but I thought somebody here might know a trick to get the spacing anyway – John Nov 9 at 14:19
  • I can suggest using Tikz to manually add the brackets wherever you would like. It'll be a little bit messy but will do what you're looking for. – Sina Ahmadi Nov 9 at 14:24
up vote 5 down vote accepted

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

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}
  • Thanks @samcarter! – JPi Nov 13 at 0:08

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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