What is the correct way to make the "does not divide" symbol in plain LaTeX 2e?
I'm talking about the symbol that is a vertical bar with a slash through it. I prefer not to install AMS or other packages, but instead to use plain LaTeX.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityWhat is the correct way to make the "does not divide" symbol in plain LaTeX 2e?
I'm talking about the symbol that is a vertical bar with a slash through it. I prefer not to install AMS or other packages, but instead to use plain LaTeX.
Try this:
$x\nmid y$
It has been known to 'save the day'.
Using \not
with |
works with plain LaTeX:
\documentclass{article}
\begin{document}
$2 \not| \;3 $
\end{document}
The symbols \\
, and \:
and \;
create varying degrees of space if the symbols get too close.
a|b
is nice and compact, a\not|b
puts a strange amount of space between a and |.
Jun 22, 2012 at 1:28
\not
has so much extra space but if I had to guess it might be because \not
can be used in conjunction with a lot of other symbols which are wider than | [eg \not\in or \not\subset]. So some combinations will look better than others depending on the symbol width being negated.
\not\mid
was ok when I used it on mathoverflow (mathoverflow.net/questions/256598/…)
Dec 7, 2016 at 7:41
To minimize used packages you can do this:
\newcommand{\ndiv}{\hspace{-4pt}\not|\hspace{2pt}}
From then on \ndiv
will add the sign with appropriate spaces before and after.
ex,em
but still it would not be robust enough to be used elsewhere.
The ∤ symbol is available in Unicode as U+2224 Does Not Divide, and as \nmid
from many packages, including: unicode-math
, amssymb
, stix
, stix2
, newtxmath
and the less commonly-usedmnsymbol
, fdsymbol
and boisk
.
After fine tuning, I'm pretty happy with defining a new command \doesnotdivide
(or whatever you'd like to name it) as: \newcommand{\doesnotdivide}{\not\hspace{2.5pt}\mid}
I found that three points was too much and 2 points was not enough offset.
em
would be better than pt
, since it would automatically adjust to a change in font size.