Beamer Align – Resolving Weird Extra Spacing Issues in Align*

alignbeamer

This compiles, but there's a big gap between the 1st and 2nd term in the equation for no discernible reason. Changing the &'s and \\ on the last line doesn't change anything

\documentclass[9pt]{beamer}
\usepackage{tikz, amsmath}
\usepackage[none]{hyphenat}

\begin{document}
\begin{frame}
\begin{align*}
    M(x)    &= 500x^3          &+200x^2           &+400 \\
    M(1.01) &= 500\cdot 1.01^3 & +200\cdot 1.01^2 & +400 \\
    M(1.01) &= 1119.1705 & &  \\
\end{align*}
\end{frame}

\end{document}

enter image description here

Best Answer

The align environment alternates right and left justified columns, intentionally placing significant space between rl pairs. Instead, I think you may want to use alignat:

enter image description here

\documentclass[9pt]{beamer}
\usepackage{tikz, amsmath}
\usepackage[none]{hyphenat}

\begin{document}
\begin{frame}

\begin{alignat*}{4}
    M(x)    &= 500x^3          &&+200x^2           &&+400 \\
    M(1.01) &= 500\cdot 1.01^3 && +200\cdot 1.01^2 && +400 \\
    M(1.01) &= 1119.1705
\end{alignat*}

\end{frame}

\end{document}