[Tex/LaTex] Strike-through Tilde Accent

accentsmath-modepdftex

I am working with graphs (V, E) which have a fixed number of common neighbours and common non-neighbours for each pair of adjacent vertices, and non-adjacent vertices as well. To denote these four invariants, I'm using the following symbols:

enter image description here

I'm not too keen on it though (I don't like how _\sim and _\nsim look). I'm considering using the \tilde accent, but I would like an analogous \nottilde accent, that is, a stricken-through \tilde accent:

enter image description here

I'd imagine creating such a command would involve quite a bit of hassle, especially to be compatible with \widetilde. I have no idea how to go about creating it (I used paint for the picture above).

I'm also open to other suggestions for this notation! Thanks.

Best Answer

What about this?

\documentclass{article}
\usepackage{amsmath,amssymb}
\def\nottilde#1{\overset{\ifx#1f\hspace{.5ex}\fi\lower0.8ex\hbox{\tiny$\nsim$}}{#1}}
\def\xtilde#1{\overset{\ifx#1f\hspace{.5ex}\fi\lower0.8ex\hbox{\tiny$\sim$}}{#1}}
\begin{document}
$\tilde{e}\xtilde{e}\nottilde{e}\xtilde{f}\nottilde{f}$
\end{document}

enter image description here

Related Question