If I wanted \not< but with vertical strikethrough rather than a diagonal strikethrough, how would I make it?
- 165
-
Does this answer your question: https://tex.stackexchange.com/a/20613/18228? – Herr K. Feb 11 '21 at 18:54
-
@HerrK. Close, but it's horizontal, not vertical – Akiva Weinberger Feb 11 '21 at 19:01
-
And this: https://tex.stackexchange.com/questions/108193/not-equal-sign-%e2%89%a0-with-a-vertical-bar?rq=1 (seems better than mine) – Rmano Feb 11 '21 at 19:07
2 Answers
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...
- 40,848
- 3
- 64
- 125
-
And you could also separate out a
\vnotcommand through\mkern-8mu\mid\mkern8muthen, 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
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}
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$
- 31,130
-
-
@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


