4

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.

2 Answers 2

6

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}

enter image description here

0
1

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}

enter image description here

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}

enter image description here

2
  • I'm getting the error: "! LaTeX Error: File `listofitems.sty' not found." Commented Feb 9, 2017 at 18:53
  • @OsamaKawish Can get \listofitems.tex, listofitems.sty and listofitems_en.pdf at ctan.org/pkg/listofitems Commented Feb 9, 2017 at 18:55

You must log in to answer this question.

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