176

The title says it all, both \dfrac{a}{b} and \frac{a}{b} make fractions, so what is the difference between the two?

3
  • 7
    displayed frac. Sep 27, 2013 at 16:25
  • 29
    This is clearly mentioned in the amsmath user guide (section 4.11.1 The \frac, \dfrac, and \tfrac commands, p 14).
    – Werner
    Sep 27, 2013 at 16:43
  • 2
    Here's the current, working link to a home for the amsmath package and user guide. Oct 8, 2019 at 9:48

3 Answers 3

181

Mainly it's a difference of size:

  • \dfrac means that the fraction is set in displaystyle

  • \tfrac means that the fraction is set in textstyle

  • with \frac: the actual context implies the decision above

For example, if you have a complicated mathematical expression in the middle of some array environment (which, by default, employs text-style math), you can use \dfrac to force the use of displaystyle math mode for the fraction

\dfrac and \tfrac are from the amsmath package

Aside: TeX provides four math "styles": display style, text style, script style, and scriptscript style. scriptstyle is generally meant for level-1 subscripts and superscripts, and scriptscriptstyle is for level-2 subscripts and superscripts.

133

\dfrac forces the fraction into display mode, no matter which mode it is in already. On the other hand \tfrac forces it to be in text mode.

Usually \tfrac is used much more than \dfrac. Of course \frac should be used in almost every case but \tfrac is handy for coefficients, as shown by the code below.

\[
   f(x) =  \frac{1}{2} x^2 = \dfrac{1}{2} x^2 = \tfrac{1}{2} x^2
\]

enter image description here

$
   f(x) =  \frac{1}{2} x^2 = \dfrac{1}{2} x^2 = \tfrac{1}{2} x^2
$

enter image description here

0
7

Though I am responding late, The answer specific to the question is by masu and daleif. This is a piece of supplement information to the question. One has to use the package xfrac to use sfrac.

\usepackage{xfrac}

$

f(x) = (\sfrac{1}{2})x^2

$

enter image description here

2
  • 8
    The question here is about \dfrac and \frac, not \sfrac from xfrac, unfortunately.
    – Werner
    Nov 22, 2021 at 6:54
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Nov 22, 2021 at 7:02

You must log in to answer this question.

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