# Overlapping vertical spacing in math mode

I am currently trying to get the display

By doing this code, i was able to produce

\begin{gather}
1 \uparrow 1 = {}^1 1 = 1 \nonumber \\
2 \uparrow \uparrow 2 = {}^2 2 = 4 \nonumber \\
3 \uparrow \uparrow \uparrow 3 = {}^{{}^{{}^3}} {}^3 3 = 3 \uparrow \uparrow 3 \uparrow \uparrow 3 = \underbrace{3^{3^{3^{3^{3^{3^{.^{.^{.^{3}}}}}}}}}}_{3^{3^3} \text{ threes}}\tag{14}\label{eq.14}
\end{gather}


Of course, this is still not the correct display, so i then tried to use an array environment and use negative \vspace, i got close, but not quite the perfect display. Here is the code for that

$\begin{array}{c} \vspace{0.2cm} 1 \uparrow 1 = {}^1 1 = 1 \nonumber \\ \vspace{-0.3cm} 2 \uparrow \uparrow 2 = {}^2 2 = 4 \nonumber \\ 3 \uparrow \uparrow \uparrow 3 = {}^{{}^{{}^3}}{}^3 3 = 3 \uparrow \uparrow 3 \uparrow \uparrow 3 = \underbrace{3^{3^{3^{3^{3^{3^{.^{.^{.^{3}}}}}}}}}}_{3^{3^3} \text{ threes}} \vspace{1cm}\tag{28}\label{eq.28} \end{array}$


I probably could tinker around with that, but I am pretty sure that a better method exists, so if anyone can help it would be very appreciated.

PS: If a better method exists to only get the equation tag on the last line instead using \nonumber, please let me know

Edit: One of the comments suggested to use \smash, so i tried and the code gave

\begin{gather}
1 \uparrow 1 = {}^1 1 = 1 \nonumber \\
2 \uparrow \uparrow 2 = {}^2 2 = 4 \nonumber \\
\smash{3 \uparrow \uparrow \uparrow 3 = {}^{{}^{{}^3}} {}^3 3 = 3 \uparrow \uparrow 3 \uparrow \uparrow 3 = \underbrace{3^{3^{3^{3^{3^{3^{.^{.^{.^{3}}}}}}}}}}_{3^{3^3} \text{ threes}}}\tag{14}\label{eq.14}
\end{gather}


So using \smash seem to have only worked to remove the vertical spacing, but it has pushed the line to the left...

• use \smash{.....} around the power tower and it will hide its height completely Feb 14, 2021 at 14:38
• You can use $$\begin{gathered}[b] …… \end{gathered}$$. Feb 14, 2021 at 14:54
• @DavidCarlisle using \smash does help to remove the vertical space, but the problem is that the centering seems kind of off to the left... Feb 14, 2021 at 15:57
• @Bernard I tried to use $$\being{gathered}[b] ... \end{gathered}$$ and it doesn't seem to work.. Feb 14, 2021 at 15:58
• you have not provided an example that anone can run to see any centering (the use of \nonumber with array in your second fragment looks very odd by the way). It always makes a question clearer if it contains an example that shows the problem, not just fragments that can not easily be tested. Feb 14, 2021 at 15:59

You wrote,

If a better method exists to only get the equation tag on the last line ..., please let me know.

I think you need a combination of an equation environment, an aligned[b] environment, and a \smash[t]{...} directive.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\label{eq.14} \begin{aligned}[b] % 'b' means "place equation number on bottom line" 1 \uparrow 1 &= {}^1 1 = 1 \\ 2 \uparrow\uparrow 2 &= {}^2 2 = 4 \\ 3 \uparrow\uparrow \uparrow 3 &= \smash[t]{ {}^{{}^{{}^3\!}} {}^3 3 = 3 \uparrow\uparrow 3 \uparrow\uparrow 3 = \underbrace{3^{3^{3^{3^{3^{3^{.^{.^{.^{3}}}}}}}}}}_{3^{3^3}\text{ threes}} } \end{aligned}
\end{document}


Addendum: Here's an additional solution, which (a) employs an alignedat environment to perform alignment on both the first and second instance of =, (b) changes the math status of \uparrow, \uparrow\uparrow, and \uparrow\uparrow\uparrow to math-bin (the default math status is math-rel), and (c) implements @egreg's suggestion to provide a bit more distance between the rows and to enlarge the contents of the _{...} component of the \underbrace directive in row 3.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\label{eq.14} \addtolength\jot{4pt} \begin{alignedat}[b]{2} % 'b' means "place equation number on bottom line" 1 \mathbin{\uparrow} 1 &= {}^1 1 &&= 1 \\ 2 \mathbin{\uparrow\uparrow} 2 &= {}^2 2 &&= 4 \\ 3 \mathbin{\uparrow\uparrow\uparrow} 3 &= \smash[t]{ {}^{{}^{{}^3\!}} {}^3 3} &&= \smash[t]{3 \mathbin{\uparrow\uparrow} 3 \mathbin{\uparrow\uparrow} 3 = \underbrace{3^{3^{3^{3^{3^{3^{.^{.^{.^{3}}}}}}}}}}_{\mathclap{\textstyle 3^{3^3}\text{ threes}}} } \end{alignedat}
\end{document}


The main idea is the same as Mico's about smashing the top of the big object, but with some improvements on spacing and size of characters.

\documentclass{article}
\usepackage{amsmath}

\ExplSyntaxOn
\NewDocumentCommand{\hyop}{m}
{
\mathbin{ \prg_replicate:nn { #1 } { \uparrow } }
}
\ExplSyntaxOff
\newcommand{\preexp}[2]{\vphantom{#2}^{#1}\kern-\scriptspace#2}

\begin{document}
\label{eq.14} \begin{aligned}[b] % 'b' means "place equation number on bottom line" 1 \hyop{1} 1 &= \preexp{1}{1} = 1 \\ 2 \hyop{2} 2 &= \preexp{2}{2} = 4 \vphantom{\preexp{\preexp{3}{3}}{3}}\\ 3 \hyop{3} 3 &= \preexp{\preexp{3}{3}}{3} = 3 \hyop{2} ( 3 \hyop{2} 3 ) = \smash[t]{ \underbrace{ 3^{3^{3^{3^{3^{3^{{\cdot}^{{\cdot}^{{\cdot}^{3}}}}}}}}} }_{\text{\displaystyle 3^{3^3} threes}} } \end{aligned}

\end{document}
`