I had a look at a few of the questions regarding align
and split
but didn't see anything which addressed this particular alignment issue:
I have something like the following equations, with conditions right-aligned. One of the conditions is longer than the space permitted by the column, which pushes everything off the page and moves the equation numbers below all the lines.
\begin{align}
& x = a + b + c + d + e + f + g + h + i + j, & \text{some condition} \\
& y = a + b + c + d + e + f + g + h + i + j, & \text{some much longer condition}
\end{align}
I would like to split this up so that it looks something like:
x = a + b + c + d + e + f + g + h + i + j some condition (1) y = a + b + c + d + e + f + g + h + i + j (2) some much longer condition
I tried to solve this with the split
environment but without any luck, despite trying many different positions of &
's such as:
\begin{align}
& x = a + b + c + d + e + f + g + h + i + j, & \text{some condition} \\
\begin{split}
& y = a + b + c + d + e + f + g + h + i + j, \\
& \text{some much longer condition}
\end{split}
\end{align}
In the end I just broke up the long condition into two lines as in the below, but I am not sure that the product looks as good.
\begin{align}
& x = a + b + c + d + e + f + g + h + i + j, & \text{some condition} \\
& y = a + b + c + d + e + f + g + h + i + j, \begin{split}
\text{some} \\
\text{much} \\
\text{longer} \\
\text{condition}
\end{split}
\end{align}
Is there any way to achieve my original goal using the align
environment?
Here's a MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\setlength{\textwidth}{30em}
\begin{document}
\section{No split}
\begin{align}
& x = a + b + c + d + e + f + g + h + i + j, & \text{some condition} \\
& y = a + b + c + d + e + f + g + h + i + j, & \text{some much longer condition}
\end{align}
\section{Attempted whole line split}
\begin{align}
& x = a + b + c + d + e + f + g + h + i + j, & \text{some condition} \\
\begin{split}
& y = a + b + c + d + e + f + g + h + i + j, \\
& \text{some much longer condition}
\end{split}
\end{align}
\section{Word break split}
\begin{align}
& x = a + b + c + d + e + f + g + h + i + j, & \text{some condition} \\
& y = a + b + c + d + e + f + g + h + i + j, \begin{split}
\text{some} \\
\text{much} \\
\text{longer} \\
\text{condition}
\end{split}
\end{align}
\end{document}