# How to place a \sim over \equiv similar to \simeq and \cong?

As the question states, I want a tilde over \equiv similar to \simeq and \cong commands. To be more specific, they tilde needs to be closer to the \equiv symbol.

I've tried using stackrel and DeclareMathOperator* but they place it way too high.

I've even tried to place it under empty space over \equiv as math operator as in

\DeclareMathOperator*{\eq}{\equiv}
\newcommand{\poly}{\eq^{\stackrel{\sim}{\hspace*{2em}}}}


yet still no luck.

Any suggestions? Thanks.

A straightforward modification of the code for \cong in fontmath.ltx

\DeclareRobustCommand
\cong{\mathrel{\mathpalette\@vereq\sim}} % congruence sign
\def\@vereq#1#2{\lower.5\p@\vbox{\lineskiplimit\maxdimen\lineskip-.5\p@
\ialign{$\m@th#1\hfil##\hfil$\crcr#2\crcr=\crcr}}}


Here is the new \ccong (change the name to your liking):

\documentclass{article}

\makeatletter
\DeclareRobustCommand{\ccong}{\mathrel{\mathpalette\@verequiv\sim}}
\newcommand{\@verequiv}[2]{%
\lower.5\p@\vbox{
\lineskiplimit\maxdimen
\lineskip-.5\p@
\ialign{%
$\m@th#1\hfil##\hfil$\crcr
#2\crcr
\equiv\crcr
}%
}%
}
\makeatother

\begin{document}

$A=B\equiv C\cong D\ccong E$

\end{document}


Here, I use a stack.

\documentclass{article}
\usepackage{amssymb,amsmath,stackengine}
\DeclareMathOperator*{\eq}{\equiv}
\newcommand{\poly}{\mathrel{\ensurestackMath{%
\stackengine{-.5pt}{\equiv}{\sim}{O}{c}{F}{F}{S}}}}
\begin{document}
$A \equiv A \simeq A \cong A \poly A$
\end{document}


EDIT: Here is a version that works for smaller math styles

\documentclass{article}
\usepackage{amssymb,amsmath,stackengine,scalerel}
\DeclareMathOperator*{\eq}{\equiv}
\newcommand{\poly}{\mathrel{\ThisStyle{\ensurestackMath{%
\stackengine{-.5\LMpt}{\SavedStyle\equiv}{\SavedStyle\sim}{O}{c}{F}{F}{S}}}}}
\begin{document}
$A \equiv A \simeq A \cong A \poly A$\par
$\scriptstyle A \equiv A \simeq A \cong A \poly A$\par
$\scriptscriptstyle A \equiv A \simeq A \cong A \poly A$\par
\end{document}


• I'm getting the error: "! LaTeX Error: File listofitems.sty' not found." – Osama Kawish Feb 9 '17 at 18:53
• @OsamaKawish Can get \listofitems.tex, listofitems.sty and listofitems_en.pdf` at ctan.org/pkg/listofitems – Steven B. Segletes Feb 9 '17 at 18:55