7

The text size shrinks in a multiline equation when I use fractions. How can I keep it the same as the non-multiline equation size?

\begin{equation}
    \begin{cases}
    p = -\frac{1}{\chi}\text{div}(\mathbf{u}),\\
    \rho \frac{\partial^2}{\partial t^2} = - \nabla p.
    \end{cases}
\end{equation}

I need it the same size as this -

\begin{equation}
 p = -\frac{1}{\chi}\text{div}(\mathbf{u})
\end{equation}

2 Answers 2

7

Using \dfrac instead of \frac will force the fraction to display at the "usual" size.

Hence using this code will work:

\begin{equation}
    \begin{cases}
        p = -\dfrac{1}{\chi}\mathrm{div}(\mathbf{u}),\\
        \rho \dfrac{\partial^2}{\partial t^2} = - \nabla p.
    \end{cases}
\end{equation}

Edit: As suggested by Manuel, using \dcases is a better alternative

The code becomes

\begin{equation}
    \begin{dcases}
        p = -\frac{1}{\chi}\mathrm{div}(\mathbf{u}),\\
        \rho \frac{\partial^2}{\partial t^2} = - \nabla p.
    \end{dcases}
\end{equation}
2
  • May be better use dcases instead of cases?
    – Manuel
    Commented Nov 29, 2015 at 13:28
  • you also need amsmath package for these commands to work
    – Eyad Ahmed
    Commented Dec 24, 2023 at 6:52
4

You can use the dcases environment provided by mathtools. Note also some improvements to your code.

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

\DeclareMathOperator{\Div}{div}
\newcommand{\vect}[1]{\mathbf{#1}}

\begin{document}

\begin{equation}
\begin{dcases}
p=-\frac{1}{\chi}\Div\vect{u}, \\
\rho\frac{\partial^2}{\partial t^2}=-\nabla p
\end{dcases}
\end{equation}

\end{document}

enter image description here

A further improvement for the partial derivative: with

\newcommand{\pder}[3][]{%
  \frac{\partial\if\relax\detokenize{#1}\relax\else^{#1}\fi#2}
       {\partial#3\if\relax\detokenize{#1}\relax\else^{#1}\fi}%
}

in the preamble, you can use

\pder{f}{t}
\pder[2]{f}{t}
\pder{}{t}
\pder[2]{}{t}

and your case would be the last one.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .