Register to reply

Parentheses around mismatched size fractions in LaTeX

by wolfbd
Tags: latex fractions, vphantom
Share this thread:
Apr29-12, 05:43 PM
P: 1
I have a fraction in the denominator of another fraction, and I'm trying to put a set of brackets around it. However, I can't seem to get them to size properly. Example below:

 Q_1 \left[ \frac{Q_2}{4\pi \left( r_2+\sqrt{ \dfrac{Q_2\gamma A}{4\pi}} \right)^2 } + Q_3 \right]
which comes out as

Q_1 \left[ \frac{Q_2}{4\pi \left( r_2+\sqrt{ \dfrac{Q_2\gamma A}{4\pi}} \right)^2 } +Q_3\right]

Obviously, I want to get rid of the space at the top. I've tried using \Bigg[ (which ends up too small) and even creating my own sizing in the preamble:
(which ends up too big since it only accepts integer sizing, as far as I can tell). Any ideas? Thanks.
Phys.Org News Partner Science news on
Mysterious source of ozone-depleting chemical baffles NASA
Water leads to chemical that gunks up biofuels production
How lizards regenerate their tails: Researchers discover genetic 'recipe'
May2-12, 09:17 PM
Sci Advisor
HW Helper
P: 7,111
You can get the brackets right by putting the fraction inside a matrix.

That leaves the ##Q_1## in a silly place, but you can fix that with the \vphantom{} command. \vphantom{} works out the vertical height of what is inside the {}, and creates an invisible zero-width object of that size.

So, in front of the matrix in [ ] , make another matrix without backets, use \vphantom to make it the same height, and the ##Q_1## will line up with the ##Q_3##.

\vphantom{\frac{Q_2}{4\pi \left( r_2+\sqrt{ \dfrac{Q_2\gamma A}{4\pi}} \right)^2 }}
\frac{Q_2}{4\pi \left( r_2+\sqrt{ \dfrac{Q_2\gamma A}{4\pi}} \right)^2 } + Q_3
\vphantom{\frac{Q_2}{4\pi \left( r_2+\sqrt{ \dfrac{Q_2\gamma A}{4\pi}} \right)^2 }}
\frac{Q_2}{4\pi \left( r_2+\sqrt{ \dfrac{Q_2\gamma A}{4\pi}} \right)^2 } + Q_3

if you are a perfectionist, you might want to put a bit of negative space in between the two matrices as well.

Easy peasy.
May2-12, 10:54 PM
P: 15,150
Quote Quote by wolfbd View Post
Q_1 \left[ \frac{Q_2}{4\pi \left( r_2+\sqrt{ \dfrac{Q_2\gamma A}{4\pi}} \right)^2 } +Q_3\right]
One problem is that you are fighting LaTeX by using \dfrac. Simply changing to \frac improves things to some extent:

[tex]Q_1 \left[ \frac{Q_2}{4\pi \left( r_2+\sqrt{ \frac{Q_2\gamma A}{4\pi}} \right)^2 } + Q_3 \right][/tex]

There are other ways to represent division. Sometimes [itex]a/b[/itex] looks better than [itex]\frac a b[/itex]:
[tex]Q_1 \left[ \frac{Q_2}{4\pi \left( r_2+\sqrt{ (Q_2\gamma A)/(4\pi)} \right)^2 } + Q_3 \right][/tex]

You can pull the [itex]4\pi[/itex] inside the parentheses as [itex]\sqrt{4\pi}[/itex]. This clears the denominator that is the root cause of your problems:
[tex]Q_1 \left[ \frac{Q_2}{\left( r_2\sqrt{4\pi}+\sqrt{Q_2\gamma A} \right)^2 } + Q_3 \right][/tex]

Sometimes \left and \right are too big. This is one of those times. Use \bigl and \bigr instead:
[tex]Q_1 \left[ \frac{Q_2}{\bigl( r_2\sqrt{4\pi}+\sqrt{Q_2\gamma A} \bigr)^2 } + Q_3 \right][/tex]

Register to reply

Related Discussions
Latex editors that can treat fractions Math & Science Software 1
Bug Latex fractions too big Forum Feedback & Announcements 0
When decimals and/or fractions are only within the parentheses in a linear equation Precalculus Mathematics Homework 4
Putting Brackets around fractions LATEX Math & Science Software 4
LaTeX size General Discussion 2