0

I'm trying to split an equation over two lines, and split a comment over two lines as well, using the split environment.

\begin{align} 
\begin{split}
f(x) =& f(y) + g(y) & \text{Something happening here}\\
    &+ A_n + B_n &\text{something else happening here}
\end{split}
\end{align}

I'm getting errors telling me I can't use & characters within the split environment.

2 Answers 2

2

You probably want aligned or alignedat if you want more control on the space between the two blocks.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{alignedat}{2}
f(x) &=f(y) + g(y)      &\qquad& \text{Something happening here} \\
     &\quad + A_n + B_n &      & \text{something else happening here}
\end{alignedat}
\end{equation}

\end{document}

enter image description here

-1

It seems the best way to do this is to have two splits:

\begin{align} 
\begin{split}
f(x) =~& f(y) + g(y) \\
    &+ A_n + B_n 
\end{split}
\begin{split}
& \text{Something happening here} \\
& \text{something else happening here}
\end{split}
\end{align}
2
  • =& will give bad spacing, you probably want &= (or ={}& ) Commented Jan 28, 2020 at 1:17
  • 1
    This generates errors due to the $ and missing \end{split} please post a small error free document Commented Jan 28, 2020 at 1:26

You must log in to answer this question.

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