36

In addition to the "divides" relation, denoted b | a, there is also a "divisible by" relation expressing the converse (a is divisible by b), often designated with three vertical dots.

Up until now, I've settled with

\mathrel{\vdots}

Example

But there are two problems with the symbol:

  • It is too high relative to the numbers
  • It is also somewhat too long

A search with Detexify and the Comprehensive LaTeX Symbol List doesn't reveal anything more suitable. How do I get a good looking "divisible by" symbol?

3
  • 1
    Is $A \scalebox{0.75}{\vdots} B$ closer to what you want?
    – percusse
    Oct 23, 2011 at 21:56
  • I agree with egreg that this is not an universal convention. Is this a local convention (in some country)? or is this a new convention in some new branch of mathematics? I am just curious.
    – Sony
    Oct 24, 2011 at 11:57
  • 4
    @Sony: This is common in some Eastern Europe countries and Russia. On the other hand, the "|" relation is much less used in these countries. Oct 24, 2011 at 13:05

4 Answers 4

46

I've never seen that symbol. But here's how you can define it

\DeclareRobustCommand{\divby}{%
  \mathrel{\vbox{\baselineskip.65ex\lineskiplimit0pt\hbox{.}\hbox{.}\hbox{.}}}%
}

It's just an almost straightforward modification of \vdots.

enter image description here

In order that the symbol changes size when used in subscripts/superscripts, just enclosing the main part in \text will do.

\documentclass{article}
\usepackage{amsmath}

\DeclareRobustCommand{\divby}{%
  \mathrel{\text{\vbox{\baselineskip.65ex\lineskiplimit0pt\hbox{.}\hbox{.}\hbox{.}}}}%
}

\begin{document}

\[
a\divby b \qquad \sum_{k\divby n}a_k
\]

\end{document}

enter image description here

2
7

Here's another way to define a \divby symbol (it additionally requires graphicx though):

\newcommand*{\divby}{\mathrel{\rotatebox{90}{$\hskip-1pt.{}.{}.$}}}%

enter image description here

5

I have another solution. :) You could also use TikZ. (This may be quite straightforward if you load the package in your preamble anyway.)

\documentclass{article}

\usepackage{tikz}

\newcommand{\divby}{\ \tikz \foreach \y in {0ex, 0.65ex, 1.3ex} \fill (0,\y) circle (0.5pt);\ }

\begin{document}
$15\divby 3$
\end{document}

enter image description here

2
  • 2
    As the old saying goes: "When in doubt, use TikZ" Oct 24, 2011 at 10:35
  • 12
    I would actually recommend against using TiKZ for typography when there is a vanilla LaTeX solution such as egreg's, because it will be much slower. Oct 24, 2011 at 11:12
5

Using the stackengine package:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}
\newcommand{\divby}{%
 \setstackgap{S}{0.45ex}%
 \mathrel{\Shortstack{{.} {.} {.}}}}
\begin{document}
$15\divby 3$
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .