The standard not-divides mark in math mode is \nmid, which prints a proper relation symbol with the right spacing.
If you’re writing number theory, abstract algebra, or proof-based notes, the not-divides mark shows up all the time. It looks small on the page, yet a sloppy version stands out at once. A badly built symbol can throw off spacing, clash with nearby glyphs, or look like a hurried patch job.
LaTeX already gives you a clean answer. In most cases, the symbol you want is \nmid. Put it in math mode between two expressions, and LaTeX treats it as a relation, not as a random slash dropped over a vertical bar. That relation spacing is what makes the line read well.
So if you want to say that 3 does not divide 10, write $3 \nmid 10$. That produces the standard notation mathematicians expect. If you’ve been trying things like \not| or stacking symbols by hand, stop there. You’ll get a cleaner result with less work by using the built-in command meant for the job.
Why The Symbol Trips People Up
The confusion starts with the divides sign itself. Many writers learn \mid early, since $a \mid b$ is plain and reliable. Then they try to negate it the same way they would negate equality or set membership. That’s where the trouble begins.
LaTeX’s \not command can work with some symbols, yet it doesn’t always give the best-looking result when you throw it in front of anything that looks close enough. A vertical bar is narrow. A slash laid over it can look cramped, crooked, or too light, based on the font setup and the package stack in the document.
Math notation needs visual rhythm. A relation symbol sits between terms and needs room on each side. When the mark is built the wrong way, the line can feel uneven. That may sound tiny, though readers notice it fast when they skim equations across a page.
Not Divide Symbol In LaTeX For Proper Math Spacing
The clean, standard command is \nmid. In normal use, you’ll place it inside inline math or display math just like any other relation:
$a \nmid b$
That prints the not-divides relation with proper spacing. In most documents, this command is available when you load AMS math symbol support. If your file already uses common math packages, there’s a good chance you’re covered. If not, add one of these in the preamble:
\usepackage{amssymb}\usepackage{amsmath}
If you only care about the symbol itself, amssymb is the usual pick. If your document already uses environments like align, split equations, or improved fraction handling, you may already have AMS tools in place. The amsmath package documentation lays out how those math tools fit into normal LaTeX work.
What To Type In Real Documents
Most of the time, your source will look like one of these:
$p \nmid n$\[ d \nmid (a-b) \]If \(k \nmid m\), then the remainder is nonzero.
That’s it. No overlay tricks. No custom macro needed. No visual repair work later.
Why \nmid Beats Homemade Fixes
When LaTeX knows a symbol is a relation, it spaces it like one. That matters in tight inline math, longer chains of notation, and displayed equations with several operators on one line. A homemade slash-plus-bar combo may look passable in one font size, then fall apart in subscripts or theorem environments.
\nmid also gives your source file a cleaner look. If someone else opens the document, they know right away what you meant. Good source code should read almost as clearly as the output.
Common Commands Around The Not-Divides Mark
The not-divides sign usually appears beside a small set of related symbols. Knowing the group helps you write faster and keep notation consistent from page to page. When you treat them as a family, your math source feels less scattered.
Here’s a quick map of the commands you’ll use most often:
| Meaning | LaTeX Command | Typical Output |
|---|---|---|
| Divides | \mid |
\(a \mid b\) |
| Does Not Divide | \nmid |
\(a \nmid b\) |
| Parallel | \parallel |
\(AB \parallel CD\) |
| Not Parallel | \nparallel |
\(AB \nparallel CD\) |
| Element Of | \in |
\(x \in S\) |
| Not An Element Of | \notin |
\(x \notin S\) |
| Less Than Or Equal To | \le or \leq |
\(x \le y\) |
| Not Less Than Or Equal To | \nleq |
\(x \nleq y\) |
That pattern is useful: relation symbols often have a negated partner. Yet the command name is not always made by dropping \not in front of the base form. In many cases, LaTeX already has a dedicated negated symbol that looks better and spaces better.
If you want a broader symbol lookup page when you forget a command name, the Comprehensive LaTeX Symbol List is one of the handiest references around. It’s a faster route than guessing command names and compiling over and over.
Does Not Divide Symbol In LaTeX In Daily Use
The not-divides sign turns up most often in number theory, divisibility tests, congruences, and ring proofs. You might use it in a sentence, in a theorem statement, or in a multi-line derivation. The command stays the same in each setting, though the surrounding style can change how readable the line feels.
Inside Running Text
Inline math should stay compact. Use \(a \nmid b\) or $a \nmid b$ and let LaTeX handle the spacing. Don’t add manual spaces around the symbol. That tends to make inline math look loose compared with the rest of the paragraph.
A sentence like “Since \(p \nmid n\), the quotient is not an integer” reads cleanly and keeps the prose moving. That’s the sweet spot for lecture notes, blog posts, and textbook-style explanations.
In Displayed Equations
Displayed math gives the symbol more room, so bad notation stands out even more. The proper command earns its keep here. Say you write
\[ p \nmid n \implies n \not\equiv 0 \pmod p \]
The line feels balanced because each relation is treated as a relation. That sounds obvious, yet it’s one of those small pieces that makes a page of math look finished rather than patched together.
In Proofs And Definitions
Proof writing often repeats the same relation many times. Repetition is where weak notation starts to grate. If a proof has five or six divisibility statements in a row, \nmid keeps the texture even across the whole block.
This matters in definitions too. A line like “Let \(S=\{n \in \mathbb{Z} : d \nmid n\}\)” is short, though it relies on crisp symbol choice. One awkward mark can make set-builder notation look messy fast.
| Situation | Best Practice | What To Avoid |
|---|---|---|
| Inline sentence | Use \(a \nmid b\) with no manual spacing |
Adding \; or extra spaces around the symbol |
| Display math | Use \nmid as a relation inside the equation |
Stacking \not over a plain bar by guesswork |
| Shared class notes | Load AMS symbol support in the preamble | Relying on custom hacks no one else will read easily |
| Subscripts or scripts | Test compiled output if the relation appears in small math | Assuming a handmade symbol will scale well |
| Long proofs | Stick to one notation pattern all the way through | Mixing \nmid, slashed bars, and text phrases |
What To Do If \nmid Does Not Compile
If LaTeX throws an “undefined control sequence” error, the first thing to check is your package setup. In a bare document, the command may not be available until you load the right symbol package. Add \usepackage{amssymb} in the preamble and compile again.
If the error stays, check whether your document class or template strips packages in some custom way. This can happen in journal templates, teaching platforms, or auto-generated note systems. In those setups, a package may be blocked, renamed, or loaded through a wrapper class you don’t see at first glance.
Also watch for typos. \nmid is easy to mistype as \nmid, \notmid, or \not\mid. One of those may compile, though the output may not be what you want. The first should fail, the second is not standard, and the third can look off.
A Safe Minimal Example
If you want a clean test file, use this:
\documentclass{article}
\usepackage{amssymb}
\begin{document}
\(3 \nmid 10\)
\end{document}
If that compiles, the symbol itself is fine and the issue sits elsewhere in your main file.
When A Custom Macro Makes Sense
Most writers don’t need one. Still, if you use the symbol dozens of times and want source code that reads more like plain language, a small macro can help. You could define something like \newcommand{\ndiv}{\nmid} and write $a \ndiv b$ all through the document.
That can be nice in class notes, team projects, or large textbooks where notation is standardized in one preamble file. The win is not visual. The output stays the same. The win is source readability and easier global edits later.
Even then, build your macro on top of \nmid, not on top of a homemade overlay. Let the real symbol do the hard work.
Small Style Choices That Make Math Look Better
The not-divides sign usually appears in material with many relations, congruences, or set conditions. Good surrounding style helps it shine. Use math mode for the whole expression, not just the symbol. Keep variables in math italics. Put words like “if” and “then” in text, not inside math mode unless the line truly needs them there.
Try to stay consistent about related notation too. If you write \mid for divisibility, don’t swap to a plain text pipe later. If you use \nmid in one theorem, don’t change to “does not divide” in another unless prose reads better there. Steady notation makes dense material easier to scan.
One last tip: compile and look, not just type and trust. LaTeX usually gets relation spacing right, though the final page is still the judge. A quick glance at the PDF catches more than a long stare at raw source.
Final Word
If you need the does not divide symbol in LaTeX, use \nmid. It gives you the standard mark, proper spacing, and cleaner source code. Load AMS symbol support if your template does not already do it, then use the symbol like any other math relation. That’s the neat, dependable way to write divisibility statements that look right on the first compile.
References & Sources
- The LaTeX Project.“User’s Guide for the amsmath Package.”Supports the use of AMS math packages for standard mathematical notation and improved equation handling in LaTeX documents.
- CTAN.“The Comprehensive LaTeX Symbol List.”Provides a broad symbol reference that includes command names for mathematical symbols such as the not-divides relation.
