# Vertical Space between formula and brackets

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}
$$\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{document}


Current result:

• 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

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}

$$\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$$

$$\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{document}


Also check out \vphantom

\documentclass[a4paper]{article}
\usepackage{mathtools}
\begin{document}
$$\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{document}

• Thanks @samcarter! – JPi Nov 13 at 0:08