[Tex/LaTex] Displaystyle fractions in a system of equations

displaystyleenvironmentsequations

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

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

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{equation}\begin{cases}\displaystyle}{\end{cases}\end{equation}}

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{equation}\begin{cases}\displaystyle}{\end{cases}\end{equation}}

\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?

Best Answer

You could use dcases from the mathtools package

screenshot

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

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

\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

screenshot

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