2

For example:

\begin{align}
    \begin{cases}
        & x = X/Z = 1\\
        & y = Y/Z = 1\\
    \end{cases}
\end{align}

Any way to have the spacing for the X and Y be the same so that the other variables/digits align?

Werner
  • 603,163

3 Answers3

4

From what I can tell, you are using the cases environment to place a french brace on the left side of your expressions.

Assuming that this is all you are using cases for, you can use regular delimiters instead of cases, which gives you greater flexibility with alignment environments.

As in Stefan Kottwitz's second answer to this question, you can just use the \left{ and \right. delimiters to achieve the same result as cases in your example above.

Also from that answer, you can use the alignedat environment to control the alignment of your expressions.

This code aligns the expressions about both = signs:

\usepackage{amsmath}

\begin{document}
\[
  \left\{% open left french brace delimiter
  \begin{alignedat}{2}
    x &= X/Z &= 1 \\
    y &= Y/Z &= 1 \\
  \end{alignedat}
  \right.% close the delimiter
\]
\end{document}

However, this code does not have equation numbers as you would find with align.

If the equation numbers are necessary for your project, you could use \hphantom{} as discussed in Peter Grill's answer to this question within an align environment to preserve the equation numbers, though this would be a much more fiddly process than using alignedat with delimiters as discussed above.

  • 1
    +1 for the term "french brace" for { and }. So far, I've only seen them called "curly braces". – Mico Dec 01 '15 at 06:28
2

You could insert an array environment inside the cases environment to create extremely flexible formatting options. (In the code below, the @{{}={}} particles generate appropriately-spaced = symbols.)

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
    \begin{cases}
        \begin{array}{l @{{}={}} l @{{}={}} l}
            x & X/Y/Z & 1\\
            abc & M/L & uvw
        \end{array}
    \end{cases}
\end{align}
\end{document}

Remark: For the example at hand, neither the align environment nor the cases environment is needed. A simpler (and more compactly formatted) solution would be:

\begin{equation}
    \left\{
        \begin{array}{l @{{}={}} l @{{}={}} l}
           x & X/Y/Z & 1\\
           abc & M/L & uvw
        \end{array}
    \right.
\end{equation}
Mico
  • 506,678
1

You need a mixture of empheq and some box manipulation. Here are three different options, depending on what kind of equation numbering you're after (more options exist):

enter image description here

\documentclass{article}

\usepackage{empheq} % Loads mathtools and amsmath

\begin{document}

\begin{empheq}[left=\empheqlbrace]{align}
  x &= X/Y/Z = 1 \\
  y &= \mathrlap{Y/Z}\phantom{X/Y/Z} = 1
\end{empheq}

\begin{equation}
  \begin{cases}
    &\hspace*{-1em} x = X/Y/Z = 1 \\
    &\hspace*{-1em} \mathrlap{y}\phantom{x} = \mathrlap{Y/Z}\phantom{X/Y/Z} = 1
  \end{cases}
\end{equation}

\[
  \begin{cases}
    &\hspace*{-1em} x = X/Y/Z = 1 \\
    &\hspace*{-1em} \mathrlap{y}\phantom{x} = \mathrlap{Y/Z}\phantom{X/Y/Z} = 1
  \end{cases}
\]

\end{document}

\mathrlap is provided by mathtools which is loaded automatically by empheq.

Some minor left-brace size differences are noticeable, but it would mostly be negligible to the inconspicuous reader.

Werner
  • 603,163