I was checking the solution here
for make a small fraction. I get the fraction but I noticed that there is a variation in the vertical alignment in display mode and inline mode:
\documentclass[12pt]{memoir}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{stackengine}
\newcommand{\smath}[1]{\text{\scalebox{0.95}{$#1$}}}
\newcommand{\myfrac}[3][0pt]{\belowbaseline[-.65\baselineskip]{\smath{\genfrac{}{}{}{3}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}}}}
\begin{document}
$\tanh\Bigl(\myfrac{\alpha}{2}\Bigr)$
\begin{align}
\tanh\Bigl(\myfrac{\alpha}{2}\Bigr)
\end{align}
\end{document}
As you can see in display mode the fraction is moved up a little bit. This doesn't happen with equation
environment nor \[ \]
. What am I doing wrong?
genfrac
is defined inamsmath
; I don't think it's redefined instackengine
.align
should give exactly the same result asequation
. But Id be inclined to use
\dfrac` instead of trying to define something else.