# How to align two \begin{cases}?

The code below generates the following figure:

Is there a way to align these two equations, like this:

i.e., align at the beginning of the bracket (not the at the equal signs!)

I have consulted several other questions, but they either did not have "cases", or they did not have equations labels. Thus the code will not work with labelled equations.

Does anyone know a catch-all method for aligning these types of equations? Thanks in advance!

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}
$$\label{eqn:equation1} \begin{cases} a &= b^2 + c^2\\ y(t) & = a \end{cases}$$
now, the second equation
$$\label{eqn:equation2} \begin{cases} b &= \sin(b^2) + c^2\\ y(t) & = b \end{cases}$$
\end{document}


Update: Please also assume that the equations are tagged

\begin{document}
$$\tag*{eq 1} \label{eqn:equation1} \begin{cases} a &= b^2 + c^2\\ y(t) & = a \end{cases}$$
now, the second equation
$$\tag*{eq 2} \label{eqn:equation2} \begin{cases} b &= \sin(b^2) + c^2\\ y(t) & = b \end{cases}$$
\end{document}

• You could use \intertext, see here: tex.stackexchange.com/questions/29119/…, for example. – CarLaTeX Sep 13 '17 at 5:32
• The use of cases here doesn't really fit with the alignment of the equations within the brackets. The spacing is wrong between the LHS and RHS. – Werner Sep 13 '17 at 20:04

You can use \intertext, from the amsmath package, inside an align environment:

This sort of example, I believe, is exactly why the \intertext command exits: it inserts a "normal" line of text between equations that have common alignment points.

Here's the full MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}
\begin{align}
\tag*{eq 1}
\label{eqn:equation1}
&\begin{cases}
a &= b^2 + c^2\\
y(t) & = a
\end{cases}
\intertext{now, the second equation}
\tag*{eq 2}
\label{eqn:equation2}
&\begin{cases}
b &= \sin(b^2) + c^2\\
y(t) & = b
\end{cases}
\end{align}
\end{document}

• Oh, I see that @CarLaTeX has already suggested \intertext in the comments... +1 – Andrew Sep 13 '17 at 7:51
• Of course, the spacing around the relation = is incorrect here, since the space is provided as the separation between the case and it's domain, rather than the relation spacing. – Werner Sep 19 '17 at 18:18
• @Werner Yes I agree. – Andrew Sep 20 '17 at 18:39

You can set both using aligned, and add the largest right-hand side to the shorter construction (top) via a \phantom:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\tag*{eq 1} \label{eqn:equation1} \left\{\begin{aligned} \mathrlap{a}\phantom{y(t)} &= b^2 + c^2 \\ y(t) &= \mathrlap{a} \phantom{\sin(b^2) + c^2} \end{aligned}\right.
now, the second equation
\tag*{eq 2} \label{eqn:equation2} \left\{\begin{aligned} \mathrlap{b}\phantom{y(t)} &= \sin(b^2) + c^2 \\ y(t) &= b \end{aligned}\right.

\end{document}


Left-hand side adjustments follow a similar pattern of overlapping and \phantom placement to achieve a left-aligned look.