Math & Sciencecombining \frac and \sum

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
dkeeble
Posts: 2
Joined: Thu May 21, 2009 1:57 pm

combining \frac and \sum

Post by dkeeble »

Hi,

I have an equation that is a fraction with a \sum on the top and no sum on the bottom. Using \left and \right, or \bigl \bigr mean that the delimiters are centred around the line of the fraction - but the sum on top is much higher than the constants on the bottom, so it looks silly. My question thererfore is: Can you adjust the height of the centre of the delimiters with respect to the contained maths? Or, even better, can one change the height of the maths with respect to the delimiters, ie change the height of the centre line from the \frac?

Code: Select all

\chi^2=\left[\displaystyle\frac{\displaystyle\sum_\mathbf{h}{w_\mathbf{h}\left(F_{\mathbf{h}(o)}^2-F_{\mathbf{h}(c)}^2\right)^2}}{N_{\text{R}}-N_{\text{P}}}\right]^{\frac{1}{2}}
Image

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
emime
Posts: 9
Joined: Wed Apr 15, 2009 10:43 pm

combining \frac and \sum

Post by emime »

I'm not sure to understand what you mean with ...
> Can you adjust the height of the centre of the delimiters with respect to the contained maths?

Maybe you want just play with a raisebox.

Code: Select all

\[
\chi^2=\left[\raisebox{-2mm}{$\displaystyle
\dfrac{\displaystyle\sum_\mathbf{h}{w_\mathbf{h}\left(F_{\mathbf{h}(o)}^2-F_{\mathbf{h}(c)}^2\right)^2}}
{N_{\text{R}}-N_{\text{P}}}$}\right]^{\frac{1}{2}}
\]
But more rigorous to have the equal sign aligned with the fraction...so I would move slightly down the denominator only.

Code: Select all

\[
\chi^2=\left[\displaystyle
\dfrac{\displaystyle\sum_\mathbf{h}{w_\mathbf{h}\left(F_{\mathbf{h}(o)}^2-F_{\mathbf{h}(c)}^2\right)^2}}
{\raisebox{-2mm}{$N_{\text{R}}-N_{\text{P}}$}}\right]^{\frac{1}{2}}
\]
Hope it does the trick.
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: combining \frac and \sum

Post by Juanjo »

Replace the denominator by \rule{0pt}{15pt}N_{\text{R}}-N_{\text{P}} and adjust the height of the invisible rule.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
dkeeble
Posts: 2
Joined: Thu May 21, 2009 1:57 pm

combining \frac and \sum

Post by dkeeble »

emime wrote: Maybe you want just play with a raisebox.
That does exactly what I wanted, thanks!
Post Reply