2

If I wanted \not< but with vertical strikethrough rather than a diagonal strikethrough, how would I make it?

2 Answers2

4

What about this:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\newcommand\vnotless{\mathrel{<\mkern-8mu\mid\mkern8mu}}

\begin{document} $a \vnotless b$ \end{document}

For sure there are better ways, but this works as a dirty-n-fast method...

enter image description here

Rmano
  • 40,848
  • 3
  • 64
  • 125
  • And you could also separate out a \vnot command through \mkern-8mu\mid\mkern8mu then, right? – Akiva Weinberger Feb 11 '21 at 19:09
  • Yes, something like \newcommand{\vnot}[1]{\mathrel{#1\mkern-8mu\mid\mkern8mu}} should more or less work, but depending on the operator may need adjustments... – Rmano Feb 11 '21 at 20:48
4

A version which more or less scales correctly in math styles (not quite perfect, though...)

\documentclass{article}

\usepackage{amsmath} % for \binrel@ \usepackage{amssymb} % for \lessgtr as test

\makeatletter \newcommand{\vnot}[2][0]{\def@tempa{\mkern#1mu}\binrel@{#2}\binrel@@{\mathpalette\vnot@{#2}}} \newcommand{\vnot@}[2]{% {\m@th\ooalign{\hidewidth$#1@tempa|$\hidewidth\cr$#1#2$}}% }

\makeatother

\begin{document}

$a \vnot[1]{<} b$ $\scriptstyle a \vnot[1]{<} b$ $\scriptscriptstyle a \vnot[1]{<} b$ \par $a<b$ $\scriptstyle a<b$ $\scriptscriptstyle a<b$

\smallskip $a \vnot{\lessgtr} b$ $\scriptstyle a \vnot{\lessgtr} b$ $\scriptscriptstyle a \vnot{\lessgtr} b$ \par $a\lessgtr b$ $\scriptstyle a\lessgtr b$ $\scriptscriptstyle a\lessgtr b$

\end{document}

enter image description here

The horizontal placing is tricky, because the "absolute center" might not be optically ideal. I let a small kern to be added through the optional parameter.

$a \vnot{<} b$\par
$a \vnot[1]{<} b$\par
$a \vnot[2]{<} b$

enter image description here

campa
  • 31,130
  • Much better than mine, yes! – Rmano Feb 11 '21 at 19:33
  • @Rmano "Better" is relative. Yours works for the particular symbol, and always will; mine tries to work in general, and manual tweaking will thus be necessary. I'm not sure which is "better"... – campa Feb 11 '21 at 19:45
  • @campa I'm not sure whether using \binrel@ is really needed, as it seems unlikely to negate an operation symbol. Anyway, nice answer! – egreg Feb 11 '21 at 21:41
  • @egreg The thought crossed my mind when I was done writing the answer, but then I've decided to leave it. Worst-case scenario it's useless, but not wrong. – campa Feb 11 '21 at 22:10