TransWikia.com

How do I create a vertical version of not?

TeX - LaTeX Asked by Akiva Weinberger on April 26, 2021

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

2 Answers

What about this:

documentclass{article}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
newcommandvnotless{mathrel{<mkern-8mumidmkern8mu}}

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

Correct answer by Rmano on April 26, 2021

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@@{mathpalettevnot@{#2}}}
newcommand*{vnot@}[2]{%
   {m@thooalign{hidewidth$#1@tempa|$hidewidthcr$#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
$alessgtr b$
$scriptstyle alessgtr b$
$scriptscriptstyle alessgtr 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

Answered by campa on April 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP