Questions tagged [cases]

The {cases} environment is provided by the {amsmath} package to typeset cases in math. The {mathtools} package introduces extensions, e.g. the cases* and dcases environments.

The environment is provided by the package to typeset cases (e.g. piecewise function definitions) in math. The package introduces extensions, e.g. the cases* and dcases environments.

Example usage:

\[|x| = \begin{cases}
    x,  & x \ge 0\\
    -x, & x   < 0.
\end{cases}
\]

enter image description here

In addition to the cases environment, there are several related environments made available by the mathtools package.

  • The cases* environment, in which the second column is set in text mode rather than math mode.
  • The dcases environment sets the first column in display-style math, rather than text-style math.
  • The rcases environment typesets the brace on the right, rather than the left.
  • You can combine any of these, e.g. drcases typesets the brace on the right and uses display math, and drcases* additionally sets the second column in text style.
521 questions
20
votes
2 answers

Cases environment compresses fractions?

what should I do to stop the cases environment compressing the first line of the following? \begin{equation} \alpha_{mn} = \begin{cases} \frac{16\mu^2}{mn\pi^2\left[\pi^2(m^2/a^2 + n^2/b^2) - \mu^2\right]} &\mbox{for } m \mbox{ and } n \mbox{ odd;}…
Stefan
  • 261
  • 1
  • 2
  • 4
16
votes
1 answer

Problem compiling cases environment

I am trying to compile a simple cases example, but I'm having trouble with the tabular separator &. Here's my code: \begin{equation} f(x) = \begin{cases} x + 1 & \mbox{blabla} \\ x & \mbox{otherwise} …
erickrf
  • 450
9
votes
1 answer

How to leave more room between two lines

I have this case formula which I need to make a little more readable by adding a little more space, vertically, between the two cases. \begin{cases} f = -\frac {w_1*m + w_2*\frac{-d}{d_M} + w_3*\frac{r}{N} + w_4*s}{w_1+w_2+w_3+w_4} &\hbox{when }m…
Lucien S.
  • 193
  • 4
9
votes
2 answers

Aligning equations in a cases environment

In my work, I am trying to typeset the following system of equations. \begin{equation*} \begin{cases} \pi_n (i) = {n^2}/{\vol(G_n)} \cr \pi_n (j) = {n}/{\vol(G_n)} \cr q^{(n)}_{ij} = {1}/{n^2 } \cr q^{(n)}_{ji} =…
malin
  • 3,727
  • 4
  • 23
  • 35
7
votes
2 answers

Vertical skip for the operator \cases

I would like to create a formula with the operator \cases, whose lines contain sums: \begin{cases}\sum (...) \\ \sum (...) \end{cases} Expressions in the sums are huge, and it would be natural to add some 'smallskip' between two lines. How can I do…
limanac
  • 257
6
votes
3 answers

Redefining cases command

I do not like that \begin{cases} \end{cases} only allows for one alignment tab, as I usually want to use two. \left\{ \begin{array}{rlr} a & = c & x=1 \\ b & = d & x=2 1 \end{array} \right. Is it possible to redefine cases (or define a new…
flawr
  • 1,123
  • 1
  • 9
  • 19
6
votes
2 answers

How can I do cases in plain text mode?

I am trying to draw cases as in the attached picture. Is there any way to draw one in plain text mode? If not possible, is there any way to put y variables at the bottom of the leftmost brace? Thanks.
6
votes
4 answers

How to separate a case into lines in a cases environment

I need to divide both the condition and equation part of some cases into lines, as the cases would not fit to text width. I read some similar questions and could not see that solves my problem. A MWE is…
ozi
  • 529
5
votes
1 answer

Control shrinking of font size in cases environment

I'm, using the cases environment of the amsmath package and I was wondering whether there is a method to control the shrinking of certain elements of it. E.g. when there is a fraction, the elements in the nominator and denominator are shrinked…
bonanza
  • 2,141
  • 2
  • 26
  • 37
5
votes
1 answer

Numbering equations in cases environment separately

I have a problem with separate numbering of equations. My code is: \documentclass[10pt,a4paper]{article} \usepackage{amsmath} \usepackage[subnum]{cases} \begin{document} \begin{numcases}{n=} y \begin{cases} x<2 …
Suzie
  • 1,289
4
votes
5 answers

Compress cases environment horizontally

I currently have the following cases environment: \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{lipsum} \begin{document} \lipsum[66] \[ G(x,u) = \begin{cases} -\dfrac{\cosh (\pi - x - u) + \cosh(\pi + x + u) - 2\cosh (\pi + x -…
4
votes
3 answers

How to have two separate right curly bracket in align or equation environment?

I essentially want to get my equation to look like this, but can't quite get it. I've used drcases but then the alignment is difficult. I've also tried empheq, but still having issues. Any ideas?
C.Hegg
  • 41
4
votes
1 answer

Equation with cases

How to typeset this equation? Please help me.
4
votes
3 answers

Error with cases enviroment: missing $ inserted

Hey there I have a problem with the cases enviroment inside an equation i'm getting the error missing $ inserted but i don't know why. I already searched and found that there are now blank lines inside a equation allowed but i'm not sure where they…
Naro
  • 71
3
votes
1 answer

Is there an alternative of \arraycolsep for cases environment?

I have this problem: I can control the space in array environment with \arraycolsep, but it doesn't work in cases environment. Is there an alternative of \arraycolsep for cases…
1
2 3 4