45

I would like to write something like the definition of a gradient operator in cartesian coordinates.

\usepackage{amsmath}
\begin{equation}
    \nabla \Phi =
    \begin{pmatrix}
        \frac{\partial \Phi}{\partial x} \\
        \frac{\partial \Phi}{\partial y} \\
        \frac{\partial \Phi}{\partial z} \\
    \end{pmatrix}
\end{equation}

The fractions are rendered small, as when they are rendered inline, but I don't like it in that particular instance.

I knew this would happen since it is documented there: http://en.wikibooks.org/wiki/LaTeX/Mathematics#Matrices_and_arrays

Even if I increase the spacing by adding [0.5em] after the double-backslash, it still doesn't look very good. I have a lot of space so I'd like the content of the matrix not to squeeze itself.

How can I make the content of a matrix using its normal size and not its inline size?

1 Answer 1

61

The \dfrac macro renders fractions as those in displayed math, even if it is part of an inline equation, fraction, or other setting where LaTeX prefers to typeset an inline version.

Conversely, I frequently find myself using \tfrac, which renders fractions in an inline (or "text mode") fashion even if the setting is display mode, because I often find the large fractions distracting from what is important in my equations.

As with most useful but basic macros for mathematics, these are provided by the amsmath package.

Example code:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Some fractions in inline math:
\( \dfrac{\sqrt 2}{2} \bigg/ \frac{\sqrt 2}{2} \bigg/ \tfrac{\sqrt 2}{2} \)

\vspace{1ex}
Some fractions in displayed math (in and outside of some environments):
\begin{gather*}
  \begin{split}
    \dfrac{\sqrt 2}{2} \bigg/ \frac{\sqrt 2}{2} \bigg/ \tfrac{\sqrt 2}{2}           \\
    \begin{bmatrix}
      \dfrac{\sqrt 2}{2} & \frac{\sqrt 2}{2} & \tfrac{\sqrt 2}{2}
    \end{bmatrix}
  \end{split}
  \qquad
  \begin{cases}
    \dfrac{\sqrt 2}{2} \\[2ex] \frac{\sqrt 2}{2} \\[2ex]  \tfrac{\sqrt 2}{2}
  \end{cases}   \\
\end{gather*}
\end{document}

Result: Sample images of fractions

4
  • 3
    Adding to Niel de Beaudrap’s answer, you might find display-style fractions run against each other in matrices. Use \renewcommand{\arraystretch}{1.25} after \begin{pmatrix} if you need to expand the matrix. 1.25 is just a suggested stretch value; play around with it to find what looks best in your document.
    – AstroPig7
    Commented Aug 15, 2012 at 14:46
  • 2
    @AstroPig7: See also Using display style fraction in a matrix environment. Note that although \arraystretch is an excellent suggestion, it doesn't quite do what one would expect. Commented Aug 15, 2012 at 19:24
  • 1
    Sometimes I astound myself with my blockheadedness- I've been writing things like $a \cdot \begin{LARGE}\frac{b}{c}\end{LARGE}$ for years...
    – Andrew
    Commented Feb 4, 2016 at 3:14
  • Related: \nicefrac Commented Jul 2, 2019 at 13:18

You must log in to answer this question.

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