When I use the \frac
command, I notice that the characters used for the fraction terms become smaller than those which are not in the \frac
command. Is there a way to correct it?
4 Answers
A larger (nicer?) version of the fraction can be obtained with \dfrac
.
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align}
\gamma &= \frac{1}{\sqrt{1-\frac{v^2}{c^2}}} \\
& \notag \\
\gamma &= \dfrac{1}{\sqrt{1-\dfrac{v^2}{c^2}}}
\end{align}
\end{document}
-
6
-
-
@barbarabeeton: The OP did not mention text mode ...– user31729Mar 29, 2015 at 7:10
-
true, but the op didn't specify display mode either. it makes a difference. actually, while i agree totally with using
\dfrac
for the "outer" one in your example, i think using it within the root is too much. the "intermediate" size (mentioned in another comment) is a good option here. Mar 29, 2015 at 13:35 -
@barbarabeeton: that's true too, but I had no impression that inline fractions are used. I used an
align
environment for true math, not inline, otherwisenicefrac
orxfrac
are the right choice– user31729Mar 29, 2015 at 18:17
For fractions, nicefrac
may be preferred. Here's a comparison:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{nicefrac}
\begin{document}
This is some text with a $\frac{1}{2}$ in it.
This is some text with a \textonehalf{} in it.
This is some text with a \nicefrac{1}{2} in it.
\end{document}
Another solution would be to use medium-sized fractions (~ 80% of displaystyle, defined in nccmath
), plus a slight increase of \baselineskip
with setstretch
. For large operators, there is a \medop
command:
\documentclass{article}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{nccmath}
\usepackage{setspace}
\setstretch{1.1}
\begin{document}
This is some text without fractions.
This is some text without fractions. This is some text without fractions.
This is some text with a $\mfrac{1}{2}$ in it: $ p(x,y) = \medop\sum_{m=1}^{\infty} \medop\sum_{n=1}^{\infty} p_{mn} \sin \bigl(\mfrac{m \pi x}{a}\bigr) \sin \bigl(\mfrac{n \pi y}{b}\bigr) $
This is again some text without fractions. Again some text without fractions.
\end{document}
-
There is one problem , if i use dfrac in this formula , some characters are small , some are big : $ p(x,y) = \sum_{m=1}^{\infty} \sum_{n=1}^{\infty} p_{mn} sin (\dfrac{m \pi x}{a}) sin (\dfrac{n \pi y}{b}) $– Farzad64Mar 29, 2015 at 11:34
-
You shouldn't use
\dfrac
for in-line formulae, unless you accept the interline skips be unequal! Note it is possible to obtain medium-sized operators like\sum
,\prod
, &c. See my updated answer. Btw, if you want to type the sine function, and not the product of 3 variabless, i, n
, you should type\sin
with a backslash.– BernardMar 29, 2015 at 12:02 -
You can use \dfrac
for larger fractions with bigger numbers. \dfrac
belongs to the amsmath
package, so you will need to import that. Also, the reason why it is called dfrac is because it is a \frac
that is in display mode, which in general makes things larger.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Large Fraction: $\dfrac{1}{2}$
Small Fraction: $\frac{1}{2}$
\end{document}
BTW, if you want to do a fraction like "1/2" (with the slash) use \sfrac
-
1
$1/2$
instead of$\frac{1}{2}$
.