In group theory it happens very often that you want to say: "The order of $H$ divides / does not divide the order of $G$." But the length of | is then always the same:

$ |H| | |G| $ produces |H|||G|

which is not ideal at all. (The negation \nmid has just this length too.) The length of "divides" should be longer than the "cardinality length". I could use

$ |H| \big| |G|$

but then there is no good way to say "does not divide" with the same length. Also, \big| is no solution when the expression has to be used in subscripts.

I thought it was just me, but I asked other group theorists, and nobody had a solution. I hope there is one.

I am seeking a division sign which is a little longer than the usual | , allows negation (with the same length) and proportionally correct use in subscripts (also under \sum etc.). It does not look professional if the "order sign" has the same length as the "divides" sign. (And what about combinations with absolute values, norms - although personally I don't use them as often as group orders.)


2 Answers 2


You should use \bigm| to make a relation symbol, so that the three consecutive bars are distinguishable from each other. If you want to make them slightly bigger, here's a way:

  \mathrel{\mkern.5mu % small adjustment
    % superimpose \nmid to \big|

$|H|\divides |G|$

$|H|\ndivides |G|$

enter image description here

See https://tex.stackexchange.com/a/22375/4427 for a short course on \ooalign.

Extended version working also in subscripts


    \nulldelimiterspace\z@\left#2\vcenter to1.2\dimen@{}\right.



$|H|\divides |G|$

$|H|\ndivides |G|$

$\displaystyle\sum_{k\ndivides |G|}k^2$

$\displaystyle\sum_{k\divides |G|}k^2$

enter image description here

  • That was very helpful indeed! Thanks a lot, also for giving the link to the short course on \ooalign. I hope this also will help to solve the remaining problem of using it as a subscript (where with the above suggestion the bar remains long). I have not yet studied it carefully enough. May 31, 2013 at 17:29
  • 1
    @HartmutLaue Not easy, because \big can't be reliably used in subscripts. But here it is.
    – egreg
    May 31, 2013 at 17:57
  • 1
    Thank you for your \big help!! I was not online for some hours and now feel most grateful, seeing what you have done for me. I'd never had found such a solution so quickly - if at all. I tried it immediately, and it works perfectly. No wonder that nobody I knew had a solution as it wants a real LaTeX expert! It surprises me that this is so much beyond the usual LaTeX repertoire because it is that common in math texts. I'll forward your solution... May 31, 2013 at 20:22
  • Wow. Very helpful. It seems to me that there's a lot of space around both symbols in the regular use, but the space compacts in the subscript (more than just the resizing of the subscript). Why is this? I like the tighter look, but I'm not sure how to tweak the regular usage without causing a change to the subscript usage. Sep 18, 2015 at 10:40
  • @TravisBemrose In “normal size” there's the usual space around relations, which is removed in subscripts by general TeX rule. The “tighter look” in normal size is bad, in my opinion. If you really want to inflict it to your reader, just remove \mathrel (and nothing else) from the main definitions.
    – egreg
    Sep 18, 2015 at 10:43

The mathabx package actually provides a \divides and \notdivides command, so a crude method is just to add \usepackage{mathabx} in your preamble and use those commands. It looks like this:

Order of G divides order of H and order of G divides order of K

Nothing fancy, just $|G| \divides |H|$ and $|G| \notdivides |K|$. The division bars are slightly shorter and thinner, and I generally think they stand out enough to be distinguishable. So that works, sort of.

However, mathabx has its own style for a bunch of other symbols. This is what x \in Y looks like, for example:

An image showing how $x\in Y$ is typeset with the mathabx package

If you don’t want to change lots of symbols, then you can tell LaTeX to only load certain symbols from the mathabx package. Adding the following to your preamble:


but not loading the mathabx package will still get you the commands I used to typeset the first image, but no other symbols will be changed. (I didn’t discover this solution independently; I read it on a different forum many years ago and added it to my template.)

That’s the method I use, and it’s worked pretty well for me.

  • 2
    Adding only the two lines that you suggest to my preamble results in ! LaTeX Error: Symbol font `matha' is not defined. What am I missing? Mar 26, 2016 at 22:57
  • On macs this can be installed via macports very easily without having to spelunk through your directory system. Feb 4, 2017 at 15:17
  • Once installed, it worked perfectly and it gives you lots of other fonts, including blackboard fonts. Feb 4, 2017 at 23:31
  • @ScottEmmons You also need to load the font, using \DeclareFontFamily, \DeclareFontShape and \DeclareSymbolFont. See this answer, or look at the style file mathabx.sty.
    – Josse
    Jan 25, 2022 at 13:50

You must log in to answer this question.

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