In the following MnWE, the macro \lhypbad
produces a good vertical alignment but doesn't respect the space around the math operator <
. See the picture below. What is the best way to fix that ?
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\newcommand\leqhyp{%
\stackrel{\text{hyp}}{\leq}%
}
\newcommand\lhyp{%
\stackrel{\text{hyp}}{<}%
}
\newcommand\lhypbad{%
\stackrel{\text{hyp}}{<\vphantom{\leq}}%
}
\begin{document}
$x \leqhyp 1 \lhyp y$
$x \leqhyp 1 \lhypbad y$
\end{document}
\text
is the wrong macro to use here. Consider\mathrm
. Why see what happens if you add\itshape
to the start of your mwe.mathtools
and its\mathclap
I'd also use\scriptscriptstyle
to make is smaller. Additionally, I'd probably not even write stuff above the equal sign as it is generally bad typesetting style.=
,\leq
... and so on.