LaTeX: Difference Between \frac and \dfrac?

  • Context: LaTeX 
  • Thread starter Thread starter FilupSmith
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion centers on the differences between the LaTeX commands \frac and \dfrac, particularly in terms of their visual representation and usage in mathematical typesetting. Participants explore the implications of using each command in various contexts, such as inline versus display math.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant notes that the primary difference observed is a slight display difference, particularly in the thickness of the fraction line.
  • Another participant suggests that the "d" in \dfrac stands for "\displaystyle," indicating that the difference is mainly relevant for inline LaTeX.
  • A different viewpoint mentions that \tfrac or \frac are suitable for text-sized fractions, while \dfrac is preferred for formulas.
  • One participant explains that \frac automatically adjusts its size based on the context (inline or display), while \dfrac and \tfrac maintain a constant size.

Areas of Agreement / Disagreement

Participants express varying opinions on the significance of the differences between \frac and \dfrac, with no consensus reached on which command is definitively better or under what circumstances each should be used.

Contextual Notes

Some claims about the scaling behavior of \frac versus \dfrac and \tfrac depend on specific contexts and may not apply universally across all LaTeX environments.

FilupSmith
Messages
28
Reaction score
0
Hi, I'm trying to learn LaTeX and one of the things I'm trying to figure out is what is the difference between \frac and \dfrac?

I mean, look:
\frac{a}{b} is: $$\frac{a}{b}$$
\dfrac{a}{b} is: $$\dfrac{a}{b}$$

Other then the thickened line, is there really any difference?
Thank you...
 
Physics news on Phys.org
Looking it up, a slight display difference is the only real change that you'll see on PF.
 
Since the "d" is short for "\displaystyle" or "\D", you'll only see a difference for inline latex, e.g., ##\frac{a}{b}## versus ##\dfrac{a}{b}##
 
I looked it up and i believe the only difference is that \tfrac or \frac allow for text sized fractions (great for 1/3, etc.) while \dfrac is best for formulas! Thanks none the less!
 
\frac automatically scales to the "best" size depending on the position in the formula, as well as changing between inline and display math. \dfrac and \tfrac don't change size.

Use \frac, unless you don't want the default size.

Code:
 ##\frac{1}{2} 3^{\frac{1}{2}}\quad 
\dfrac{1}{2}3^{\dfrac{1}{2}}\quad 
\tfrac{1}{2}3^{\tfrac{1}{2}}##

$$\frac{1}{2} 3^{\frac{1}{2}}\quad 
\dfrac{1}{2}3^{\dfrac{1}{2}}\quad 
\tfrac{1}{2}3^{\tfrac{1}{2}}$$

##\frac{1}{2} 3^{\frac{1}{2}}\quad
\dfrac{1}{2}3^{\dfrac{1}{2}}\quad
\tfrac{1}{2}3^{\tfrac{1}{2}}##

$$\frac{1}{2} 3^{\frac{1}{2}}\quad
\dfrac{1}{2}3^{\dfrac{1}{2}}\quad
\tfrac{1}{2}3^{\tfrac{1}{2}}$$
 
Last edited:

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 20 ·
Replies
20
Views
5K