Not divisible by – LaTeX symbol

math-mode

I'm looking for a method to write divisibility (or, more precisely it's negation) for 2 numbers, a and b. The fragment of code:

$a \not\vdots b$

has two major problems:

  1. The "cut" is not passing through the middle of the symbol;
  2. Extremely low space between the symbol and b.

The second one is solvable by writing:

$a \not\vdots \ b$

So, how to solve the first one? And is there any other, more elegant solution, to the second one. I'm using article class, with few packages imported (I always use "ams-" family and ocasionally others).

Best Answer

I suggest with this MWE to load centernot package. It is possible to compare the differences with your fragment of LaTeX code.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{centernot}


\begin{document}
$a \centernot\vdots b, \quad a \not\vdots b$
\end{document}

enter image description here