1

I have equations in an align environment with multiple tab stops, and I'd like to use split to render just one equation number for multiple lines of equations. However, if I have more than one tab stop per line, I get the error

Extra alignment tab has been changed to \cr.
<template> }$\hfill \endtemplate 

Here's an example that works:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{align}
f(x) &= y & g(x) &= z \\
h(x) &= a & h(x) &= b
\end{align}

\begin{align}
\begin{split}
f(x) &= y \\
h(x) &= a 
\end{split}
\end{align}

\end{document}

and produces the following output.

enter image description here

Here's an example that doesn't work. Note the only difference from the above two examples is the fact that split is being used with multiple tab stops.

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{align}
\begin{split}
f(x) &= y & g(x) &= z \\
h(x) &= a & h(x) &= b
\end{split}
\end{align}

\end{document}
2
  • 2
    Why don't you use equation and aligned? That gives just a single equation number and can handle multiple tab stops. (Explained in the documentation for amsmath, texdoc amsldoc.) Commented May 14, 2022 at 3:27
  • 3
    From amsldoc.pdf "split supports only one alignment (&) column; if more are needed, aligned or alignedat should be used."
    – mickep
    Commented May 14, 2022 at 5:29

1 Answer 1

1

I'd like to suggest that you employ an alignat environment if you need all equations numbered individually, and an equation/alignedat nested environment if you need just a single, vertically centered, equation number for all equations.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{alignat}{2}
f(x) &= y &\hspace{2.5cm} g(x) &= z \\
h(x) &= a &               h(x) &= b
\end{alignat}

\begin{equation}
\begin{alignedat}{2}
f(x) &= y &\hspace{2.5cm} g(x) &= z \\
h(x) &= a &               h(x) &= b
\end{alignedat}
\end{equation}

\end{document}

You must log in to answer this question.

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