Typesetting LaTeX fraction terms to be larger in an equation
Asked Answered
F

4

15

I have the following formula in LaTeX, based on Fisher's Exact Test. (NOTE: requires the use of the amsmath package for \binom.)

\begin{equation}
    P(i,j) = \sum_{x=|N(V_i) \cap V_j|}^{\min\{|V_j|, |N(V_i)|}
    \frac{ \binom{|V_j|}{x} \binom{|V - V_j|}{|N(V_i)| - x}}
    {\binom{|V|}{|N(V_i)|}}
\end{equation}

This renders the fraction portion with very small, difficult to read text:

equation with small text in fraction

I would like my text more readable, as in the following example:

equation with readable text in fraction
(source: plosone.org)

What trickery can I use to get LaTeX to render my equation similarly?

Fawnia answered 17/4, 2010 at 20:56 Comment(2)
The second example is from Word's Equation Editor, isn't it?Gudgeon
@Charles I'm not sure how it was generated, but it appears in the following article in PLoS One: plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0005313Fawnia
H
16

This may be what you're looking for:

\begin{equation}
    P(i,j) = \sum_{x=|N(V_i) \cap V_j|}^{\min\{|V_j|, |N(V_i)|} 
    \frac{\displaystyle \binom{|V_j|}{x} \binom{|V - V_j|}{|N(V_i)| - x}}
    {\displaystyle \binom{|V|}{|N(V_i)|}}   
\end{equation}

Formatted equation


Thought it might be good to add a reference:

A Guide to LaTeX2e, Kopka & Daly, 1995
Section 5.5 Fine-Tuning Mathematics
5.5.2 Selecting font size in formulas

In my edition, it's on pp 141-142, but this is out of stock on Amazon. The nearest Internet pointer I can find just now is here

Hydrometer answered 18/4, 2010 at 15:43 Comment(0)
G
11

For fraction you can also use continued fraction \cfrac in combination with \left and \right.

Take a look here.

Gilead answered 31/5, 2013 at 16:6 Comment(4)
I would consider cfrac to be the most correct answer.Endo
The link is broken.Furculum
@PaulWintz: fixed.Nikos
Look where, in this rather large compendium? I just see a title page.Naomanaomi
D
6

Here's one idea.

In Preamble:

\def\mathLarge#1{\mbox{\LARGE $#1$}}

Then update your equation to:

\begin{equation}
    P(i,j) = \sum_{x=|N(V_i) \cap V_j|}^{\min\{|V_j|, |N(V_i)|}  
    \mathLarge{
        \frac{ \binom{|V_j|}{x} \binom{|V - V_j|}{|N(V_i)| - x}}
        {\binom{|V|}{|N(V_i)|}}
    }
\end{equation}

Results in:

alt text

Diverting answered 18/4, 2010 at 15:49 Comment(1)
Very nice alternative, with the added bonus of having greater control over the size of the text in the fraction.Fawnia
F
2

The following lines define three fraction commands with sizes intermediate between \displaystyle and \textstyle, in order of decreasing size:

\newcommand{\sdfrac}[2]{\mbox{\small$\displaystyle\frac{#1}{#2}$}}
\newcommand{\fdfrac}[2]{\mbox{\footnotesize$\displaystyle\frac{#1}{#2}$}}
\newcommand{\ltfrac}[2]{\mbox{\large$\frac{#1}{#2}$}}

See this page if further explanation is needed.

Fucus answered 1/2, 2015 at 14:4 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.