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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
126 views

bad box in align + cases mode

Do you have any aesthetically nice suggestion to solve the bad box given by the following formula? \documentclass[11pt, english, oneside, a4paper]{book} \usepackage{amsmath} \usepackage{enumerate} \...
flos's user avatar
  • 41
1 vote
1 answer
963 views

Controlling vertical space within a cases environment

I'm trying to define a function that requires a large amount of text in a cases environment. By adding a \\ I can create some space between the top and bottom lines, but i'd rather create a ...
Abijah's user avatar
  • 475
3 votes
1 answer
696 views

"Undefined control sequence" while using conditional equations in LATEX

I used the below LaTeX commands for writing a conditional equation. Although the output shown is correct, it gives a compilation error "Undefined control sequence". Can anyone please let me know how ...
Adit's user avatar
  • 41
-2 votes
1 answer
878 views

problem of \par in the paragraph [duplicate]

\documentclass{article} \usepackage{amsmath} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \begin{document} \begin{align} \hat{\alpha} &= \begin{cases} \...
Rita ana's user avatar
3 votes
3 answers
366 views

xcolor's rowcolor blocking multi-line brackets

I am trying to make a table with different colors alternating per row, and I found that my document was compiling like this: I've had similar issues with matrices and other large braces, but not ...
Alex's user avatar
  • 31
3 votes
1 answer
1k views

Multiple alignemnt tabs within cases/equation environment

I am trying to align an equation within the cases environment like so: \begin{equation} R_i= \begin{cases} 2G_{\frac{i}{2} - 1} &= \frac{i^2 - 2i}{4}, & \text{if}\ 2 | i \\ ...
David Schumann's user avatar
8 votes
3 answers
6k views

Cases environment with angle brackets

I would like to create a cases environment showing an angle bracket, instead of a curly one. I can't re-define the environment itself because I have to use the new environment together with the old ...
fscarri's user avatar
  • 103
1 vote
3 answers
808 views

Nodes with cases in mathematics for tikZ

With thanks to this question, the accepted answer is quite clever: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,positioning} \begin{document} \begin{tikzpicture}[every left ...
StatsSorceress's user avatar
2 votes
3 answers
239 views

Putting variable name on the left using split and cases

Please, see the result of this code: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation} \begin{split} X_1^{\lambda_3 n} = \\ \begin{cases*} \sqrt{(1-\...
kentropy's user avatar
  • 123
4 votes
2 answers
584 views

Global alignment

I'm trying to do some sort of global alignment for my equations and didn't succeed to find anything online. More precisely, my cases environment inside my aligned and equation* has its own & ...
4ster's user avatar
  • 93
0 votes
2 answers
474 views

Align the number of an enumerated list with an equation with cases

How do I change the second item (the equation with cases) in the list so - the label (b) is vertically aligned with the lhs of the equation, - the equation in (b) is left aligned with the start of ...
Bryan H-M's user avatar
  • 397
0 votes
0 answers
79 views

Strikethrough equations in cases environment [duplicate]

I'm trying to put a stroke across an equation inside the cases mode. I tried both ulem and soul packages but I don't understand how they work in the cases environment. This is what I got with ulem: ...
sound wave's user avatar
1 vote
2 answers
73 views

Can't create linebreak between rows of a cases environment

I have this code: \begin{equation} f_k(x) =\begin{cases} \mu (z)-z_k \mathrm{\ if} \ k = \mathrm{arg \ min_j} \| c^{(j)}-x \|_2^2 \\ 0 \quad \mathrm{otherwise} \end{cases} \end{equation} Which ...
user1816679's user avatar
0 votes
2 answers
417 views

How to enumerate with Roman numerals the items of the command \numcases [duplicate]

my code \begin{subequations} \begin{numcases}{} q - 1 & \text{se $\psi = \psi_0$ e $\chi = \chi_0$} \label{roman*} \\ -1 & \text{se $\psi = \psi_0$ e $\chi \neq \chi_0$} \\ ...
Maik's user avatar
  • 3
1 vote
1 answer
324 views

Use equation and cases for big and numerous equation

I have a system of differential equations I want to write. Some equations are very long and there are numerous. I wonder if there is a way to split the equations (automaticaly if possible) and to ...
Ccile's user avatar
  • 400
5 votes
2 answers
3k views

Small product symbol in cases environment

Suppose I would like to get this MWE: \documentclass{minimal} \usepackage[cp1250]{inputenc} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \begin{...
struct's user avatar
  • 801
2 votes
1 answer
300 views

environment of cases mess up the math operator

Thanks to another question, I have defined argmin operator. It works fine when I use it in equations except for when I apply it in cases environment. As you see, the x becomes an index instead of ...
ar2015's user avatar
  • 962
1 vote
1 answer
456 views

More and Less Space in Cases [duplicate]

Why do I have this space (red arrow)? Why I do not have more space (orange arrow)? I use cases and doublespacing. Even I use \everydisplay\expandafter{\the\everydisplay\setstretch{1}}, because of ...
Vassilis Chasiotis's user avatar
9 votes
4 answers
2k views

Phantom not working as expected in cases environment

In the image below you can see the phantom not taking up as much width as it's expected in the cases environment: Here's the MWE: \documentclass{amsart} \begin{document} \begin{align*} M+A+T & =...
tatsletni's user avatar
  • 103
6 votes
2 answers
7k views

Using align inside cases

I was trying to achieve an alignment inside a cases environment. Here is what I was trying to achieve: I actually was able to achieve the above using the following MathJax code: $$ f(x,y) = \begin{...
Skeleton Bow's user avatar
  • 1,179
2 votes
2 answers
2k views

How to align two \begin{equation}\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 ...
Shamisen Expert's user avatar
2 votes
1 answer
504 views

Boxing in cases environment

I'm working with a system $$\begin{cases} Ax+By & = C\\ Dx+Ey & = F \end{cases}$$ Is there a way to put a box around A & D, around B & E, and around C & F within the system?
user142509's user avatar
1 vote
1 answer
4k views

Align equations using \begin{cases}

I'm looking to have the beginning of the bottom equation aligned with the beginning of the top equation. Similarly, I would like to have all the "for"s aligned, so the bottom ones aligned with the top ...
jrjrjr's user avatar
  • 373
0 votes
0 answers
161 views

Is there an equivalent to the cases environment for proofs?

The cases environment is nice for displaying equations with multiple cases and short descriptions, but it is awkward for displaying proofs with multi-paragraph cases. Is there an equivalent set of ...
shmuel's user avatar
  • 1,449
1 vote
1 answer
934 views

Equation System: Addition (Beamer / Article)

I'm trying to recreate something like the image below, found in a book. It is part of the solution to an equation system. I have been able to create the equation system using the cases environment, ...
Guilherme Vargas's user avatar
4 votes
2 answers
562 views

How to use cases environment inside section or subsection command

How can I use a cases environment inside \section or \subsection directives, like this: \section{$y(t) = \begin{cases} case1 \\ case \end{cases}$} With pdflatex I get: Use of \begin doesn't match ...
Randerson's user avatar
  • 423
1 vote
1 answer
373 views

The enumeration for the cases doesn't start back up at 1 when I start a new problem. Can someone help me fix this?

\documentclass[28pt]{article} \usepackage{fancyhdr} \usepackage[includeheadfoot,margin=1.0cm]{geometry} \usepackage{amsmath,amsthm,amssymb} \usepackage{enumitem} \usepackage{mathtools} \usepackage{...
Nixie777's user avatar
  • 313
0 votes
4 answers
719 views

Using \align inside \cases

The code I was using is this: \[ \begin{cases} W_n(\mathcal{O}_k) =\{X^{(n)}=(x_0,x_1,\cdots,x_{n-1})\in W_n(k): x_i\in \mathcal{O}_k,\text{ } i\in{\{0,1,\cdots, n-1\}} \}\\ W_n(...
Jack Yoon's user avatar
  • 103
2 votes
2 answers
539 views

Stretch cases in order to be "more inclusive"

Regarding the dcases environment, I noticed that, even if now I have all the math symbols extended (for example frac), when using derivatives the bracket doesn't actually cover completely the space ...
GiuTeX's user avatar
  • 1,309
0 votes
1 answer
153 views

{cases} argument not running, rather says fraction has an extra '}'?

What is wrong with this piece of code in Latex? $$\begin{displaystyle} C =\begin{cases} \frac{4}{3}, &(\text{for color singlet configuration}) \\ -\frac{1}{6}, &(\text{for color octet ...
SchrodingersCat's user avatar
0 votes
1 answer
207 views

break LHS into multiple lines for conditional function

This is what I have right now: \begin{numcases}{\mathcal{F}(\mathcal{B}(\mathcal{P}_{err})[n],\mathcal{B}(\mathcal{P}_{cor})[n^\prime]) = } XXXXXXX \end{numcases} and it does not look good because ...
user1935724's user avatar
  • 1,339
1 vote
0 answers
778 views

Enumerating cases(Case 1, Case 2, etc.) inside problems

I am a beginner at latex and I was wondering how to enumerate cases. I tried to use \begin{case}, but the numbering is off. If I had multiple problems that involved cases, the numbering doesn't ...
Nixie777's user avatar
  • 313
2 votes
3 answers
272 views

why space between N500 and \le too large?

\begin{equation} \begin{cases} -16 \le &N_{500} \le -8.88 \times 10^{-16} \\ -4 \le &N_{501} \le 24 \\ -6.94 \times 10^{-17} \le &N_{502} \le 2.78 \times 10^{-16} \\ -24 \le &N_{511} \...
Centrino Gu's user avatar
5 votes
4 answers
417 views

Efficient way to align columns in cases environment

I wanted to know if there was an efficient way to align the first column in a cases environment instead of using the \phantom code as I have used below? The code I did somehow feels like a hack??? ...
Joe's user avatar
  • 9,080
1 vote
1 answer
646 views

only number some condition in conditional function

Thanks to the answer provided here, however, is it possible that I only number some of the conditions instead all?
user1935724's user avatar
  • 1,339
4 votes
3 answers
7k views

MathJax: Have \displaystyle apply to each case of \begin{cases}

I would like \displaystyle to apply to each of my cases: $$\begin{cases} \displaystyle \frac 1 2 \\ \frac 3 4 \end{cases}$$ But it only seems to apply to the first: How can it be applied to all ...
Tom Hale's user avatar
  • 205
3 votes
3 answers
3k views

Reduce space between condition and statement in Latex case equation

I will like to reduce the space between the statement and the condition (the blue arrow length) in the latex case equation shown in the attached figure. My aim is to make the condition move a bit to ...
cidi30bg's user avatar
  • 169
4 votes
1 answer
3k views

Equation with cases [duplicate]

How to typeset this equation? Please help me.
John Williams's user avatar
2 votes
2 answers
321 views

Problem with align and cases

I am trying to align my cases with other lines in my align environment but have had no luck thus far. Can you tell me how to align all these lines: Here is my code: \documentclass[11pt]{article} \...
Joe's user avatar
  • 9,080
2 votes
1 answer
2k views

Itemize with cases in beamer

I'm working on a beamer presentation in LaTeX and I'm trying to mix somethings that don't seem to want to go together. I'm trying to combine itemize and cases. Here is what I've tried and it didn't ...
Roger's user avatar
  • 55
3 votes
2 answers
338 views

extra alignment tab has been changed to \cr on using cases

I'm using the cryptocode package for typesetting a crytographic protocol. However, when I try using cases, I get an error saying extra alignment tab has been changed to \cr. How do I correct this? ...
pd176's user avatar
  • 133
4 votes
2 answers
2k views

Extra } or forgotten $ in equation with begin{cases}

I've been staring at this for an hour now and don't see why I'm getting this error....can anyone help? $k_\alpha = \begin{cases} \frac{\log n}{\log \frac{n \log n}{m}} \left(1 + \alpha \frac{\log^2 \...
user341502's user avatar
7 votes
5 answers
4k views

Alignment within cases

I'm trying to align the if's in the following MWE, but also keep the (n times) alignment intact. Applying the mechanism from Multiple = alignment and from Aligning conditions in cases environment, I ...
Athena Widget's user avatar
3 votes
2 answers
5k views

Align multiple equations within right braces

I'm trying to make an array of equations where some of them are marked with right braces. For the right braces I have used the rcases command from the solution offered at: https://tex.stackexchange....
tex_newbee's user avatar
3 votes
1 answer
4k views

case brackets too big? [duplicate]

document class: report \[ f(x)= \begin{cases} 1 &\text{if } x\in U\\ F(x) &\text{if } x\notin U. \end{cases} \] If $T$ is open in $[0,1]$ then \[ f^{-1}[T]=\begin{cases} \big(F^{-1}[T]\cap ...
D.S. Lipham's user avatar
1 vote
0 answers
155 views

System equation and varwidth [closed]

I have two question: How can I left-align the equation system? How can I middle-align (vertical) the item bullet? \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{...
Salvo Matteini's user avatar
1 vote
1 answer
532 views

Extra alignment tab has been changed to \cr, any clue?

Anyone know what could be causing the problem here? $$h(s) = \begin{cases} (a,0)\ & \text{if } a \not\in S\ & (a,1)\ & \text{if } a \in S \end{cases} $$
Andrew Tawfeek's user avatar
1 vote
2 answers
1k views

how to align multi level rcases in latex math

I'm trying to get an equation aligned with multiple levels of rcases: But at least one of them doesn't align. Any idea?
Farzad's user avatar
  • 147
0 votes
1 answer
757 views

Extra alignment tab error trying to justify within cases environment

I am trying to align brackets inside of cases. This is my equation: \begin{align} y(x)= \begin{cases} \bigg[ & 1+2 & \\ & +5+6 \bigg] & \text{if } x < 2, \\ \bigg[ &...
highBandWidth's user avatar
7 votes
3 answers
1k views

How to stop cases from spreading to multiple lines

Once upon a time, there was a 4 line code. A kid attempted to write it as equation (perhaps a bad idea). But, anyway, the attempt failed. The code in question had two tricky elements that made life ...
384X21's user avatar
  • 173

1
4 5
6
7 8
11