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?

2 Answers 2

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

4
  • 1
    why did you write, "I shouldn't"?
    – slew123
    Commented Dec 22, 2017 at 14:56
  • 1
    @slew123 There's a reason why the symbol is raised: the line spacing is likely to be modified when such deep symbols appear.
    – egreg
    Commented Dec 22, 2017 at 15:03
  • Is it better then to use "\begin{equation}" and "\end{equation}" rather than put this inside the text?
    – slew123
    Commented Dec 22, 2017 at 16:21
  • @slew123 You'll have problems in multiline alignments anyway.
    – egreg
    Commented Dec 22, 2017 at 16:25
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .