There are four main math styles: `\displaystyle`

, `\textstyle`

`\subscriptstyle`

and `\subsubscriptstyle`

. Let's call them D, T, S and SS.

Style D holds automatically in displayed formulas (`displaymath`

or `\[...\]`

, `equation`

, `align`

, `gather`

, `multline`

); style T is selected in in-line formulas (`$...$`

or `\(...\)`

). Styles S and SS are selected in superscripts and subscripts, first level or second (and further) respectively. Also `dcases`

typesets its contents in style D.

One can also declare a math style with the above commands, which respect grouping as usual.

The rules for fractions are:

if the fraction appears in style D, the two parts (numerator and denominator) are in style T;

if the fraction appears in style T, the two parts are in style S;

if the fraction appears in style S, the two parts are in style SS.

Further levels always choose style SS.

The construction `\dfrac{num}{den}`

is equivalent to saying

```
{\displaystyle\frac{num}{den}}
```

So it's not correct to say that `dcases`

changes `\frac`

into `\dfrac`

. Indeed, inside it (as well as in `equation`

), we'll have

```
\frac{\frac{S}{S}}{T}
```

where the letters denote the style chosen, because the numerator will be in style T as follows from the rules. Here's an example, where the overall style is D.

As it can be seen, the styles have their effect also on other symbols, the "big operators": a `\sum`

in style D will be bigger than in style T. Style D usually forces subscript and superscripts to big operators to be set below and above it (look for `\displaylimits`

, `\limits`

and `\nolimits`

).

Thus there is a big difference between

```
$\displaystyle\sum_{i=1}^{n} a_{i}$
```

and

```
$\sum\limits_{i=1}^{n} a_{i}$
```

In the first case the summation symbol will be big, in the second one it will be the normal one for style T, but with limits above and below as imposed by `\limits`

(it's not recommended to do it).

## Answers to the questions.

No, you're not correct.

No.

`\displaystyle`

acts from the point it's declared, but when in a group its effect ceases at the end of it.

Use `\displaystyle`

when you want to emulate the style chosen in displayed math. Don't use it and `\dfrac`

in in-line formulas (in general).

### Note

There's much more about math styles; for example, styles D and T differ for the placement of exponents. Moreover, the denominator of fractions is in the "cramped" version of the selected style, but discussing this would take too far away.

Perhaps you meant something like the following, note that `dcases`

*must* be in `mathmode`

, and ideally in `displayed mathmode`

such as

`\[...\]`

`\begin{equation}...\end{equation}`

`\begin{equation*}...\end{equation*}`

Here's a complete MWE:

```
% arara: pdflatex
\documentclass{article}
\usepackage{mathtools}
\begin{document}
Let $g: N \rightarrow N$ be given by
\[
n=
\begin{dcases*}
1 & if $n=1$ \\
n-1 & if $n \ne 1$
\end{dcases*}
\]
\end{document}
```

For future reference, you can view pages 17 and 18 of `the documentation`

which describe that

`dcases`

puts every column in `mathmode`

`dcases*`

puts only the *first* column in `mathmode`

, and the second column in the normal roman font of the document (hence the need to step back into `mathmode`

in the second column)

## Best Answer

The

`dcases`

environment is implemented by the`mathtools`

package, so you need to load it in the preamble: