When I use subscripts and superscript with \frac
the numerator and denominator looks very tight,
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\begin{document}
\[e^{-\frac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\[e^{-\dfrac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\end{document}
So I tried using \dfrac
but not the minus sign and fraction line are not aligned.
Anybody has a smart fix to this?
Best Answer
The cause of the misalignment is that the minus sign is in
scriptstyle
, but the fraction is being forced intodisplaystyle
. Here are a few options:\[e^{\displaystyle -\frac{(x-\mu_2)^2}{2\sigma^2_2}}\]
\[e^{\dfrac{-(x-\mu_2)^2}{2\sigma^2_2}}\]
\[e^{-(x-\mu_2)^2/2\sigma^2_2}\]
\[\exp\bigl(-(x-\mu_2)^2/2\sigma^2_2\bigr)\]