How to force alignment of "cases" brackets in an enumerate environment?

I would use an AMS alignment rather than an enumerated list.

enter image description here

\documentclass[12pt]{scrartcl}
\usepackage{enumitem}
\usepackage{amsmath,amssymb}

\begin{document}


\begin{tagsleft@true}
\renewcommand\theequation{\alph{equation}}
\begin{flalign}
\nu(A 
\wedge B) &= \begin{cases}
1,&\text{if $\nu(A) = \nu(B) = 1$};\\
0,&\text{otherwise.}\end{cases}\\
\nu(A \vee B) &= \begin{cases}
1,&\text{if $\nu(A) = 1$ or $\nu(B) = 1$};\\
0,&\text{otherwise.}\end{cases}\\
\nu(A \rightarrow B) &= \begin{cases}
1,&\text{if $\nu(A) = 0$ or $\nu(B) = 1$};\\
0,&\text{otherwise.}\end{cases}\\
\nu(A \leftrightarrow B) &= \begin{cases}
1,&\text{if $\nu(A) = \nu(B)$};\\
0,&\text{otherwise.}\end{cases}\\
\nu(\forall xA) &= \begin{cases}
1,&\text{if for all $d \in D, \nu(A_x(c_d)) =1$;}\\
0,&\text{otherwise.}
\end{cases}\\
\nu(\exists xA) &= \begin{cases}
1,&\text{if for some $d \in D, \nu(A_x(c_d)) =1$;}\\
0,&\text{otherwise.}
\end{cases}
\end{flalign}
\end{tagsleft@true}

\end{document}

A trick from mathmode (In my version (2.47) it is in section 65.1 on page 113): save the longest left hand side in a box, and then output the left hand sides in a box of that length:

\documentclass[12pt]{scrartcl}
\usepackage{enumitem}
\usepackage{amsmath,amssymb}

\begin{document}
\newsavebox\lW
\sbox\lW{$\nu(A \leftrightarrow B)$}

\begin{enumerate}[noitemsep,label=\alph*)]

\item $\displaystyle\makebox[\wd\lW][r]{$\nu(A\wedge B)$} = \begin{cases}
1,&\text{if $\nu(A) = \nu(B) = 1$};\\
0,&\text{otherwise.}\end{cases}$
\item $\displaystyle\makebox[\wd\lW][r]{$\nu(A \vee B)$} = \begin{cases}
1,&\text{if $\nu(A) = 1$ or $\nu(B) = 1$};\\
0,&\text{otherwise.}\end{cases}$
\item $\displaystyle\makebox[\wd\lW][r]{$\nu(A \rightarrow B)$} = \begin{cases}
1,&\text{if $\nu(A) = 0$ or $\nu(B) = 1$};\\
0,&\text{otherwise.}\end{cases}$
\item $\displaystyle\makebox[\wd\lW][r]{$\nu(A \leftrightarrow B)$} = \begin{cases}
1,&\text{if $\nu(A) = \nu(B)$};\\
0,&\text{otherwise.}\end{cases}$
\item $\displaystyle\makebox[\wd\lW][r]{$\nu(\forall xA)$} = \begin{cases}
1,&\text{if for all $d \in D, \nu(A_x(c_d)) =1$;}\\
0,&\text{otherwise.}
\end{cases}$
\item $\displaystyle\makebox[\wd\lW][r]{$\nu(\exists xA)$} = \begin{cases}
1,&\text{if for some $d \in D, \nu(A_x(c_d)) =1$;}\\
0,&\text{otherwise.}
\end{cases}$
\end{enumerate}

\end{document}

Output

Output image


Another approach, that works like amsmath’s align environment, only with an \item.

Packages

  • listliketab
  • mathtools for the cases* environment (no need for \text)

Macros

  • \storestyleofextra[<options>]{<environ>} is like \storestyleof just with an optional argument <options> that is given to the environment <environ>.
  • \nextnum/redefinition of \item that produces the enumeration

Environment

  • alignerate mimics a left-aligned align environment, with an \item.

Disadvantage

Sadly, \storestyleof/\storystyleofextra and \storeliststyle{} do not save the enumeration style. Though a \alph*) can easily be mimiced as can seen in the \nextnum macro.

It is probably also easy to implement an optional argument for alignerate that works like label=\alph*), the xstring package does come to mind …

Code

\documentclass[12pt]{scrartcl}
\usepackage{enumitem}
\usepackage{mathtools,amssymb}
\usepackage{listliketab}
\newcounter{listliketablabel}
\newcommand*{\nextnum}{\addtocounter{listliketablabel}{1}\thelistliketablabel)}
\makeatletter
\newcommand*{\storestyleofextra}[2][]{%
    \begin{lrbox}{\llt@list@box}
        \noindent
        \begin{minipage}{\linewidth}
            \begin{#2}[#1]
            \item[] \storeliststyle{}
            \end{#2}
        \end{minipage}
    \end{lrbox}\ignorespacesafterend
}
\makeatother
\storestyleofextra[noitemsep,label=\alph*)]{enumerate}
\newenvironment{alignerate}{%
    \begin{listliketab}
        \setcounter{listliketablabel}{0}\renewcommand*{\thelistliketablabel}{\alph{listliketablabel}}
        \renewcommand*{\item}{\nextnum &}
    \begin{tabular}{L>{\(}r<{\)}@{}>{\({}}l<{\)}R}
}{
    \end{tabular}
    \end{listliketab}
}
\begin{document}
\begin{alignerate}
    \item \nu(A \wedge B) & = \begin{cases*} 1, & if $\nu(A) = \nu(B) = 1$; \\
                                             0, & otherwise.                \end{cases*}               \\
    \item \nu(A \vee B)   & = \begin{cases*} 1, & if $\nu(A) = 1$ or $\nu(B) = 1$; \\
                                             0, & otherwise.                       \end{cases*}        \\
    \item \nu(A \rightarrow B) & = \begin{cases*} 1, & if $\nu(A) = 0$ or $\nu(B) = 1$; \\
                                                  0, & otherwise.                       \end{cases*}   \\
    \item \nu(A \leftrightarrow B) & = \begin{cases*} 1, & if $\nu(A) = \nu(B)$; \\
                                                    0, & otherwise.            \end{cases*}          \\
    \item \nu(\forall xA) & = \begin{cases*} 1, & if for all $d \in D, \nu(A_x(c_d)) =1$; \\
                                             0, & otherwise.                              \end{cases*} \\
    \item \nu(\exists xA) & = \begin{cases*} 1, & if for some $d \in D, \nu(A_x(c_d)) =1$; \\
                                             0, & otherwise.                               \end{cases*} 
\end{alignerate}
\end{document}

Output

enter image description here

Tags:

Cases

Amsmath