Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Question about LaTeX

Tags:
  1. Jul 15, 2014 #1
    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...
     
  2. jcsd
  3. Jul 15, 2014 #2

    Char. Limit

    User Avatar
    Gold Member

    Looking it up, a slight display difference is the only real change that you'll see on PF.
     
  4. Jul 15, 2014 #3

    strangerep

    User Avatar
    Science Advisor

    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}##
     
  5. Jul 15, 2014 #4
    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!
     
  6. Jul 15, 2014 #5

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    \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 (Text):
     ##\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: Jul 15, 2014
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Question about LaTeX
  1. Question about latex (Replies: 7)

  2. Question About Latex (Replies: 3)

Loading...