\[ \begin{cases}
0 & x\leq 0 \\
\frac{100-x}{100} & 0\leq x\leq 100 \\
0 & 100\leq x
\end{cases}
\]
It will build as equation (1).
I want it to build as (1a) and (1b).
How to do this? Why is this inadvisable?
\[ \begin{cases}
0 & x\leq 0 \\
\frac{100-x}{100} & 0\leq x\leq 100 \\
0 & 100\leq x
\end{cases}
\]
It will build as equation (1).
I want it to build as (1a) and (1b).
How to do this? Why is this inadvisable?
With the extension cases:
\documentclass{article}
\usepackage{cases}
\begin{document}
\begin{subequations}
\begin{numcases}{f(x) = }
0 & if $x\leq 0$ \\
\frac{100-x}{100} & if $0\leq x\leq 100$ \\
0 & if $100\leq x$
\end{numcases}
\end{subequations}
\end{document}
numcases, the first column is in math mode and the second column is in text mode.
– F. Pantigny
Jul 23 '19 at 09:11
Here are two ways: with the subnumcases environment from cases, and with alignat and package empheq. Note that in the latter case, needless to load amsmath: the package loads mathtools, which loads amsmath. I also give two variant layouts, one with the formulæ in each case vertically centred w.r.t. each other (uses eqparbox):
\documentclass[a4paper,12pt]{article}
\usepackage{empheq}
\usepackage{cases}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}
\begin{document}
\begin{subequations}
\begin{empheq}[left={f(x) = \empheqlbrace\,}]{alignat = 2}
& \eqmathbox{0} &\qquad & x\leq 0 \\
&\eqmathbox{\frac{100-x}{100}} & & 0\leq x\leq 100 \\
&\eqmathbox{0 }& &100\leq x
\end{empheq}
\end{subequations}
\bigskip
\begin{subnumcases}{f(x) =}
0 & $ x\leq 0 $ \\
\frac{100-x}{100} & $ 0\leq x\leq 100 $ \\
0 & $ 100\leq x $
\end{subnumcases}
\end{document}
cases– barbara beeton Jul 23 '19 at 16:51