Skip to main content
29 votes
Accepted

Vertical spaces between lines in cases environment

Use the optional argument to \\ to add additional space between the lines, e.g.\\[10pt]. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} X_i = \begin{cases} \...
Torbjørn T.'s user avatar
16 votes
Accepted

How to use the 'cases' environment

You cannot directly enter text in math mode: it will be considered as a succession of variables, in italic with only the very thin spacing in math mode. To enter text, you have to use the \text{…}...
Bernard's user avatar
  • 273k
15 votes

How to write cases in LaTeX?

I would load the mathtools package, which is a superset of the amsmath package, and employ that package's dcases* environment. \documentclass{article} \usepackage{mathtools} % for 'dcases*' env. \...
Mico's user avatar
  • 514k
11 votes
Accepted

Make this Equation look better aligned (Mathtools vs Plain Style)

Well, this should serve as starting point how to rewrite your code manually. Conversion from Word is really awful and not usable ... I repeat the firs equation row three times and left second and ...
Zarko's user avatar
  • 300k
11 votes

How can I write cases with grouping braces on both left and right side, and split the condition into two lines in LaTeX?

Building upon the answer from Au101, what about nesting the cases environments?: \[ X(m, n) = \left. \begin{cases} x(n), & \begin{cases} \text{for } 0 \leq n \...
Ken's user avatar
  • 111
11 votes

Braces around both sides of cases (with text)

You can simply use the (d)rcases environment from mathtools. Also, I think it's better to use \widehat with capital letters. \documentclass[12pt]{article} \usepackage{mathtools} \usepackage{amssymb} ...
Bernard's user avatar
  • 273k
11 votes
Accepted

Braces around both sides of cases (with text)

Here, I replace the cases environment with a \left\{\!\begin{aligned}...\end{aligned}\right\}. The \! seems necessary to overcome a small space introduced, I think by the leading &. \...
Steven B. Segletes's user avatar
11 votes

Align the system of equations

I have three proposals, none of which uses cases or variants, which are not suited for the job. \documentclass[a4paper]{article} \usepackage{amsmath,amssymb} \usepackage{mathtools} \usepackage{array} ...
egreg's user avatar
  • 1.1m
10 votes
Accepted

How to get the cases brace to be a link

One can try and adapt your solution How to color delimiters, which is based on collecting the material and using it in a \vphantom. The amsmath package has the convenient \collect@body to help with ...
Andrew Swann's user avatar
  • 96.3k
10 votes

How to fix the mismatch of font size of following?

You can either set the \fraction using \displaystyle (via \dfrac), or use dcases. The latter provides a better solution since it results in better vertical spacing. \documentclass{article} \...
Werner's user avatar
  • 607k
10 votes
Accepted

Scale of braces of cases environment in tabular

With use of makegapedcells defined in the makecell package: \documentclass[12pt]{article} \usepackage[a4paper, margin= .1cm, bindingoffset=0cm]{geometry} \usepackage{mathtools} \...
Zarko's user avatar
  • 300k
10 votes
Accepted

Big right brace in enumerate environment

You can measure the height of the top aligned (without the brace) and the height of the aligned with the brace. Then lower the latter so the reference point agrees with the former. \documentclass[...
egreg's user avatar
  • 1.1m
9 votes

Removing brace from the left of dcases

You can easily do it, but your readers won't be happy. \documentclass{article} \usepackage{mathtools} \makeatletter \newcases{nocases} {\quad} {$\m@th\displaystyle{##}$\hfil} {$\m@th\...
egreg's user avatar
  • 1.1m
9 votes

Function with cases or array

This seems to be a precise stylistic choice, so you should somehow make it the default by defining your own environment. \documentclass{article} \usepackage{amsmath,mathtools} \makeatletter % some ...
egreg's user avatar
  • 1.1m
9 votes
Accepted

Customize cases environment

It's relatively simple using \tikzmatrix. I created two new environments (mycurly and mybrack) with an optional argument to indicate how many are the equations, in case they are more than two. The ...
CarLaTeX's user avatar
  • 64.7k
9 votes

Nested cases, alignment and numbering

I don't think that much is gained by aligning the three equations on their respective = symbols. I'd left-align the expressions, using a numcases environment. \documentclass{article} \usepackage{...
Mico's user avatar
  • 514k
8 votes

More than two columns amsmath cases

Using only amsmath package, the environement aligned allows you to use as many columns as you want : \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} M_1 \...
Juklaa's user avatar
  • 143
8 votes

How can I write cases with grouping braces on both left and right side, and split the condition into two lines in LaTeX?

I liked @Ken’s idea, but, once you have opted for a solution that uses nested “cases-like” environments, there’s an obvious improvement that permits to get rid of the additional unwanted brace, and it ...
GuM's user avatar
  • 21.7k
8 votes

Redefining cases command

Yes. Use alignat and empheq(needless to load amsmath in this case): \documentclass{article} \usepackage[utf8]{inputenc}% \usepackage{empheq} \begin{document} \begin{empheq}[left=\empheqlbrace]{...
Bernard's user avatar
  • 273k
8 votes
Accepted

Redefining cases command

You can simply use your own definition as a new environment. \documentclass{article} \begin{document} \newenvironment{mycases}% {\left\{ \begin{array}{@{}r@{\;}lr@{}} }% {\end{array} \...
gernot's user avatar
  • 50k
8 votes
Accepted

How to stop cases from spreading to multiple lines

I don't find the layout in the original manuscript easy to follow. I'd go with something like the following instead. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \...
Mico's user avatar
  • 514k
8 votes

Alignment within cases

With aligned (from amsmath package): \documentclass[12pt,a4paper]{article} \usepackage[fleqn]{amsmath} \begin{document} \[ ns = \left\{\begin{aligned}\quad & s + s + \dotsm + s &...
Zarko's user avatar
  • 300k
8 votes
Accepted

Cases environment with angle brackets

The following code updates cases to take an optional argument. The optional argument is used as the left delimiter instead of the traditional (default) \lbrace: \documentclass{article} \usepackage{...
Werner's user avatar
  • 607k
8 votes
Accepted

How do I get a cases-like environment with a right brace?

This is just a quick and inelegant attempt. Which engine do you use (I am asking because you load inputenc (usually used for non-unicode, hence pdfLaTeX) and unicode-math (usually for unicode, hence ...
CampanIgnis's user avatar
  • 4,634
8 votes

How do I get a cases-like environment with a right brace?

Here's a solution that sets up a dedicated array-like environment called rarray. It uses two instance of rarray and one instance of array. (Aside: The array environment is very basic, but also very ...
Mico's user avatar
  • 514k
8 votes
Accepted

How do I nest cases?

I'd not use the inner brace, but a standard notation for the minimum, just split across lines. \documentclass{article} \usepackage{amsmath} \DeclareMathOperator{\lev}{lev} \begin{document} \begin{...
egreg's user avatar
  • 1.1m
8 votes
Accepted

Cases with long math equation

with \mfrac from nccmath and multlined from the mathtools package: \documentclass{article} \usepackage{mathtools, nccmath} %---------------- show page layout. don't use in a real document! \...
Zarko's user avatar
  • 300k

Only top scored, non community-wiki answers of a minimum length are eligible