# Displaystyle fractions in a system of equations

I'm trying to define an environment to use with equations' systems. So far, the best solution was

\newenironment{eqsys}{$$\begin{cases}}{\end{cases}$$}


but I noticed that if the equations had, say, partial derivative, which are fractions, those are squeezed. So I modified it, adding \displaystyle so the environment looked like this

\newenironment{eqsys}{$$\begin{cases}\displaystyle}{\end{cases}$$}


but with this trick, only the first equation in the system is correctly typeset.

The code to get the results I get is

\documentclass{scrbook}

\usepackage{amsmath}
\usepackage{mathtools}

\newenvironment{eqsys}{$$\begin{cases}\displaystyle}{\end{cases}$$}

\begin{document}
\begin{eqsys}
\tan(\theta) = \frac{\sin(\theta)}{\cos(\theta)}\\
\text{cotan}(\theta) = \frac{\cos(\theta)}{\sin{\theta}}
\end{eqsys}
\end{document}


How can I make \displaystyle repeat for each equation in the set?

-
Please compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Nov 28 '11 at 23:30
Sorry, just forgot it. The MWE I provided will recreate the odd condition I get. –  Marcello Massaro Nov 29 '11 at 9:53

You could use dcases from the mathtools package

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\newenvironment{eqsys}{$$\begin{dcases}}{\end{dcases}$$}

\begin{document}

\begin{eqsys}
\frac{1}{2}    \\
\frac{2}{5}
\end{eqsys}
\end{document}


Alternatively there is \dfrac from the amsmath package, which can be used instead of \displaystyle\frac25, but it sounds like this would be too manual for what you want.

Here is how the dcases performs with @PeterGrill's test case

\begin{eqsys}
e = 2 \frac{1}{2}\\
e = 2 \frac{1}{2}
\end{eqsys}

-
This is just what I was looking for, I didn't know about dcases! –  Marcello Massaro Nov 29 '11 at 9:55

A solution to make \displaystyle repeat for each equation would be to use \everymath={\displaystyle}, which is applied at the start of any math material. I renamed your original version as eqsysOLD and used it following the new version of eqsys for two purposes:

1. compare the output
2. test that the setting of \everymath is local and does not effect subsequent math material

## Known Issues:

• Even though this solution illustrates how to apply a specific command to each equation, dcases provides better vertical spacing. So in this specific case the solution of @cmhughes is a better alternative.

## Code:

\documentclass{article}
\usepackage{amsmath}

\newenvironment{eqsysOLD}{$$\begin{cases}\displaystyle}{\end{cases}$$}

\newenvironment{eqsys}{$$\everymath={\displaystyle}\begin{cases}}{\end{cases}$$}

\begin{document}
\begin{eqsys}
e = 2 \frac{1}{2}\\
e = 2 \frac{1}{2}
\end{eqsys}

\begin{eqsysOLD}
e = 2 \frac{1}{2}\\
e = 2 \frac{1}{2}
\end{eqsysOLD}
\end{document}

-
Compare the results on your test code to that when using dcases- you'll see that dcases performs significantly better –  cmhughes Nov 29 '11 at 0:28
@cmhughes: Excellent point. Have included that info. –  Peter Grill Nov 29 '11 at 0:39
Thanks; would you mind if I include your test case in my answer? –  cmhughes Nov 29 '11 at 0:40
@cmhughes: No of course not. –  Peter Grill Nov 29 '11 at 0:43