8

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.

2
  • What do you mean "compatible with \widetilde"? How would you envision the proper way to strike through a \widetilde? With the same small strike or with an enlarged one? Dec 5, 2017 at 18:29
  • @StevenB.Segletes I'd imagine the strikethrough to stretch out horizontally as the tilde does, however it's not that important to be honest. I'd be more interested in getting it to position itself correctly on the letter f or capital A for example. Dec 5, 2017 at 18:45

2 Answers 2

5

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

2
  • Very nice! Is there any reason the \sim looks slimmer than the \nsim here? Dec 5, 2017 at 18:33
  • Also, would it be possible to get \xtilde{f} and \nottilde{f} to look right also? I might use the letters e and f. Dec 5, 2017 at 18:43
5

A variation on my answer at Big tilde in math mode, showing \reallywidetile and \reallywidenotilde.

\documentclass{article}
\usepackage{scalerel}
\usepackage{stackengine,wasysym}

\newcommand\reallywidetilde[1]{\reallywideXtilde{#1}{\AC}}

\newcommand\reallywidenotilde[1]{\reallywideXtilde{#1}{\NAC}}

\newcommand\NAC{\stackengine{1.5\LMpt}{$\SavedStyle\AC$}{\smash{$\SavedStyle\vstretch{.35}{/}$}}{O}{c}{F}{F}{L}}

\newcommand\reallywideXtilde[2]{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle#1$}%
  \stackengine{-.1\LMpt}{$\SavedStyle#1$}{\kern.3ex%
    \stretchto{\scaleto{\SavedStyle\mkern.2mu#2}{.5150\wd0}}{.6\ht0}%
  }{O}{c}{F}{T}{S}%
}}


\def\test#1{$%
  \reallywidetilde{#1}\,
  \scriptstyle\reallywidetilde{#1}\,
  \scriptscriptstyle\reallywidetilde{#1}\qquad
  \textstyle\reallywidenotilde{#1}\,
  \scriptstyle\reallywidenotilde{#1}\,
  \scriptscriptstyle\reallywidenotilde{#1}
$\par}

\parskip 1ex
\begin{document}

\test{abcdefghijklm}
\test{abcdefghijk}
\test{abcdefghi}
\test{abcdefg}
\test{abcde}
\test{abc}
\test{ab}
\test{a}
\test{f}
\test{A}
\end{document}

enter image description here

0

You must log in to answer this question.

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