6

enter image description here

In this MWE the alignment of the last element in the tuple is not nice. How can I get the spacing for the last element at the same size as the others? The description "n+1" may overlap the comma from the first line.

\documentclass[10pt]{report}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{array}{*{21}{c}}
\Bigl( &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &\Bigr) \;. \\
    & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & \\
    & & & & & & & & & & & & & & & & & & & \uparrow & \\
    & & & & & & & & & & & & & & & & & & & n+1 &
\end{array}
\end{equation*}
\end{document}

1 Answer 1

7

The easiest trick is to put n+1 in a box of zero width:

\documentclass[10pt]{report}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{array}{*{21}{c}}
\Bigl( &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &\Bigr) \;. \\
    & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & \\
    & & & & & & & & & & & & & & & & & & & \uparrow & \\
    & & & & & & & & & & & & & & & & & & & \makebox[0pt]{$n+1$} &
\end{array}
\end{equation*}
\end{document}

A better solution is to employ the package mathtools (an extension of amsmath) which provides the macro \mathclap with the same effect but refined, since it will choose the correct math style (irrelevant in this case but important in other situations).

\documentclass[10pt]{report}

\usepackage{mathtools}% loads amsmath

\begin{document}

Without correction:
\begin{equation*}
\begin{array}{*{21}{c}}
\Bigl( &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &\Bigr) \;. \\
    & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & \\
    & & & & & & & & & & & & & & & & & & & \uparrow & \\
    & & & & & & & & & & & & & & & & & & & n+1 &
\end{array}
\end{equation*}

With \verb+\mathclap+
\begin{equation*}
\begin{array}{*{21}{c}}
\Bigl( &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &, &* &\Bigr) \;. \\
    & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & & 0 & \\
    & & & & & & & & & & & & & & & & & & & \uparrow & \\
    & & & & & & & & & & & & & & & & & & & \mathclap{n+1} &
\end{array}
\end{equation*}

\end{document}

enter image description here

2
  • You beat me by a few seconds. Well done. Mar 10, 2020 at 9:55
  • 1
    Thx. Great minds think alike ;-)
    – campa
    Mar 10, 2020 at 9:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .