8

I'm sure someone has asked this before, but can't find where!

I use the code:

$ a < b \lesssim c$

Unfortunately, it appears as:

Undersirable alignment

I want the "approximately less than sign" to be a bit lower. How can I do this?

slew123
  • 547
  • 2
  • 6
  • 15

2 Answers2

4

You can lower the symbol by the excess height with respect to <. But you shouldn't.

\documentclass{article}
\usepackage{amsmath,amssymb}

\let\originallesssim\lesssim
\let\originalgtrsim\gtrsim

\DeclareRobustCommand{\lesssim}{%
  \mathrel{\mathpalette\lowersim\originallesssim}%
}
\DeclareRobustCommand{\gtrsim}{%
  \mathrel{\mathpalette\lowersim\originalgtrsim}%
}

\makeatletter
\newcommand{\lowersim}[2]{%
  \sbox\z@{$#1<$}%
  \raisebox{-\dimexpr\height-\ht\z@}{$\m@th#1#2$}%
}
\makeatother

\begin{document}

$A<B\lesssim C\gtrsim D$

$\scriptstyle A<B\lesssim C\gtrsim D$

\end{document}

enter image description here

egreg
  • 1,121,712
1

You can use \vtop with \halign inside it:

\newcount\mstylenum 
\def\varstyle#1{\mathchoice{\mstylenum=0 #1}{\mstylenum=1 #1}{\mstylenum=2 #1}{\mstylenum=3 #1}}
\def\usestyle{\ifcase\mstylenum \displaystyle\or\textstyle\or\scriptstyle\or\scriptscriptstyle\fi}

\def\gensim#1{\mathrel{\varstyle{\vtop{\offinterlineskip
   \halign{\hfil$\usestyle##$\hfil\cr#1\cr\noalign{\kern1pt}\sim\cr}}}}}
\def\lessim{\gensim<}  \def\grtsim{\gensim>}

$a < b \lessim c \grtsim d, \scriptstyle a < b \lessim c$

\bye
wipet
  • 74,238