0

How can I even out the spacing in these fractions? I have tried \frac vs \dfrac along with \strut and I get similar results:

    \[ \bar{x} = \frac{0+1+2+5}{4} = \frac{8}{4} = 2 \]
    \[ \bar{x} = \dfrac{0+1+2+5}{4} = \dfrac{8}{4} = 2 \]
    \[ \bar{x} = \frac{0+1+2+5}{\strut 4} = \frac{8}{\strut 4} = 2 \]
    \[ \bar{x} = \dfrac{0+1+2+5}{\strut 4} = \dfrac{8}{\strut 4} = 2 \]

tex output
The third and fourth (with \strut) seem to help but surely you can't be expected to always add \strut to simple fractions.

  • 2
    Welcome to TeX.SE. What exactly is the spacing matter you're trying to change? – Mico Jun 10 '15 at 16:01
  • the fraction bar seems much much closer to the 4 than the 8. I would like it to be in the middle. – Walton Jun 10 '15 at 17:45
  • 2
    the fraction bar is positioned to accommodate "typical" fraction material with variables, and variables, e.g. y, often have descenders, or even subscripts. – barbara beeton Jun 10 '15 at 17:48
  • so can I adjust that spacing easily for numerical fractions? – Walton Jun 10 '15 at 17:49
  • It depends on what you mean by "easily". If you know how to use TeX's low-level \raise and \lower macros, you probably won't find it difficult to apply adjustments. However, I honestly would not attempt to adjust the vertical spacing. As barbara beeton has noted in her comment, the positioning of the material in the numerator and denominator was chosen for "typical" material. You'd need separate treatments of \frac{a}{b}, \frac{b}{a}, \frac{x}{y}, \frac{y}{x}, etc. And, you'd risk creating a very uneven ("ransom note") look if you have several fraction expressions side by side. – Mico Jun 10 '15 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.