Math & ScienceLoose Fractions

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Loose Fractions

Post by ghostanime2001 »

What is a good environment to type math in but also which is "loose" when writing equations in them. For example, with this code the equations and "x" in the fractions are tight at the bottom and have too much space at the top making it look awkward.

Code: Select all

$\begin{aligned}[t]\text{2.72 \%}&=\dfrac{\text{24.3 g}}{\mathrm{x}}\times\text{100 \%} \\ \dfrac{\text{2.72 \cancel{\%}}}{\text{100 \cancel{\%}}}&=\dfrac{\dfrac{\text{24.3 g}}{\mathrm{x}}\times\text{\cancel{100 \%}}}{\text{\cancel{100 \%}}} \\ 0.0272&=\dfrac{\text{24.3 g}}{\text{x}} \\ \text{x}&=\dfrac{\text{24.3 g}}{0.0272} \\ \text{x}&=\text{893.4 g/mol}\end{aligned}$
Last edited by ghostanime2001 on Fri Nov 11, 2011 8:40 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

Re: Loose Fractions

Post by shadgrind »

Not quite sure what you're asking, but if you're talking about the space between the lines you could add something like [8pt] after each \\ in the aligned environment. That would make it easier to distinguish the fractions, so that x in the denominator of one fraction isn't too close to the numerator in the fraction below it.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Loose Fractions

Post by ghostanime2001 »

Not exactly what I was looking for but what I mean is that some fractions for example

Code: Select all

\dfrac{\text{24. 3 g}}{x}
the spacing is bad for the numerator and denominator with the dividing line. Moreover, if I include this little fraction into a bigger fraction for example,

Code: Select all

\dfrac{\text{2.72 \cancel{\%}}}{\text{100 \cancel{\%}}}&=\dfrac{\dfrac{\text{24.3 g}}{\mathrm{x}}\times\text{\cancel{100 \%}}}{\text{\cancel{100 \%}}}
then you can easily see how the ugly spacing makes the little fraction inside the bigger fraction a bit harder on the eyes because the x is soooo low and sitting right above the outer bigger fraction line.
User avatar
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

Loose Fractions

Post by shadgrind »

OK, I see what you mean now. You're right, that excessive vertical space between the bar and the x in the bottom looks bad, especially when combined into a second fraction. Maybe LaTeX's typesetting isn't as "beautiful" as some people think. :)

I don't know how to reduce that space; I'll be curious to see if there is a way. But for the problem it creates when using a double fraction, you could use the \vphantom command to add some extra space below the x:

Code: Select all

\dfrac{\dfrac{\text{24.3 g}}{\vphantom{\frac{a}{b}}\mathrm{x}}\times\text{\cancel{100 \%}}}{\text{\cancel{100 \%}}}
~=~ \dfrac{\dfrac{\text{24.3 g}}{\mathrm{x}}\times\text{\cancel{100 \%}}}{\text{\cancel{100 \%}}}
Notice the extra space in the fraction on the left, which I think makes it look a little better than the one on the right:
fractionspace.png
fractionspace.png (3.78 KiB) Viewed 5837 times
Still, that excess space above the x is a problem. LaTeX appears to bottom-align the numerator and denominator of a fraction by default, which makes sense. I don't know if there's a way to center-align or top-align, or maybe some other method to change the spacing.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: Loose Fractions

Post by ghostanime2001 »

I was thinking the same for vphantom i just didn't know what to put in in it that would make a small enough vertical space to produce a very desirable result.. so i ended up using the crappy hack and slash way using \raisebox ..to the above method I raised the x by 0.5 pts. But I had to move on so i just used that but thanks for that method! Another thing.. the entire numerator from the bigger fraction has it's whole box shifted upwards. I just wanted the x to be equidistant from the outer bigger fraction bar lol.


Btw the cancel slash appears to be a little diverted away from the denominator on the left than compared on the right (which is better by my standards).
Post Reply