Written and maintained by CASRAI Editorial Board
Last updated
Who this is for: researchers and analysts typesetting a paper or thesis who need a “not equivalent”, “not equal” or other negated relation symbol in LaTeX, and want to know which command works without extra packages.
Short answer: write \neq for “not equal” (≠) and \not\equiv for “not equivalent” (≢) in math mode. \nequiv is not in the AMS symbol set, so it fails with only amssymb loaded.
What negated relation symbols are used for in research
Negated relations appear wherever a paper states that two quantities, expressions or objects are not related in a given way: ≠ in inequality constraints, ≢ in congruence and identity statements, ≁ for “not similar” and ≉ for “not approximately equal”. LaTeX handles all of them as relation symbols in math mode. Related CASRAI guides cover less-than and greater-than symbols in LaTeX and the proportional-to symbol.
Install or access
You do not install anything for the core symbols. The standard LaTeX relation table in The Comprehensive LaTeX Symbol List (CTAN, read 2026-11-07) lists \approx, \equiv, \sim, \simeq and \cong as available in plain LaTeX, and Overleaf’s symbol list (read 2026-11-07) shows \neq, \approx, \equiv and \simeq. Named negations such as \nsim and \ncong are in the symbol list’s “AMS Negated Binary Relations” table, and that document states that “AMS” means loading amssymb and/or amsmath:
\usepackage{amssymb}
Only for a precisely centred slash do you need one extra package, centernot, distributed on CTAN (version 1.4, 2016/05/16 in the source read on 2026-11-07).
Step by step: how to write “not equal” and “not equivalent” in LaTeX
How do I write “does not equal” in LaTeX?
Use \neq inside math mode: $a \neq b$ gives a ≠ b. Overleaf’s symbol list includes \neq among the relation symbols.
- Put the expression in math mode, for example
\(a \neq b\)or$a \neq b$. - For “not equivalent”, type
\not\equiv:$a \not\equiv b$.\notis a prefix that draws a slash over the relation that follows it. - For another negation, either use a dedicated command if the symbol list has one (with
amssymbloaded:\nsim,\ncong,\nparallel,\nprec,\nsucc), or prefix the base relation with\not. The CTAN LaTeX Companion example sources show\not\simalongside\nsim. - If the slash sits off-centre on a wide symbol, replace
\notwith\centernotfrom thecenternotpackage, for example$A \centernot\parallel B$.
What does \( do in LaTeX?
\( opens inline math mode and \) closes it. Overleaf’s documentation lists \(...\), $...$ and \begin{math}...\end{math} as inline delimiters, says they all work and that the choice is a matter of taste, and describes \(...\) as standard LaTeX practice. Inline math sits within the paragraph line; display math sits on its own line.
Output and how to read it
| You want | Command | Needs | Source |
|---|---|---|---|
| ≠ not equal | \neq |
nothing extra | Overleaf symbol list |
| ≢ not equivalent | \not\equiv |
nothing extra (\equiv is a standard relation) |
CTAN symbol list (\equiv); centernot documentation (\not) |
| ≁ not similar | \nsim or \not\sim |
\nsim: amssymb |
CTAN symbol list; CTAN LaTeX Companion examples |
| Not approximately equal | \not\approx |
nothing extra | CTAN symbol list (\approx); centernot documentation (\not) |
| Not congruent | \ncong |
amssymb |
CTAN symbol list, AMS negated relations |
| Centred slash on a wide symbol | \centernot |
centernot package |
centernot.dtx v1.4 |
The centernot documentation states the limitation of the prefix: “The disadvantage of \not is that it is put at a fixed location regardless of the width of the relational symbol.” Compile and look at the output before submitting a manuscript: a slash that looks slightly off is a property of \not, not a typo in your source.
What is the difference between ≈ and ∼?
They are two separate relation symbols in LaTeX: \approx prints ≈ and \sim prints ∼, and the standard symbol table lists both, along with \simeq and \cong. Which one means “approximately equal”, “similar” or “distributed as” is a notation convention of your field, journal or definitions, not something the LaTeX symbol tables decide, so define the meaning in your text.
What is the gradient symbol in LaTeX?
The gradient (del) operator is \nabla, printing ∇. Overleaf’s list of Greek letters and math symbols includes it under miscellaneous symbols, and the CTAN symbol list’s miscellaneous math table includes it too.
Troubleshooting
\nequiv gives “Undefined control sequence”
In the CTAN symbol list, \nequiv is not in the AMS negated binary relations table (that table has \ncong, \nmid, \nparallel, \nprec, \nsim, \nsucc and similar). It appears in the table for the txfonts and pxfonts packages, among others. If you only load amssymb, use \not\equiv instead.
The slash is off-centre
Use \centernot from the centernot package, which measures the width of its argument to centre the slash.
The symbol does not render on a web page
If the same source is shown through a web renderer rather than compiled, the renderer’s supported-command set applies. See the CASRAI guide to MathJax and LaTeX.
Free alternatives: ways to get the same negated symbol
| Approach | Example | Trade-off (from the sources) |
|---|---|---|
| Dedicated command (AMS) | \nsim, \ncong |
Needs amssymb; only exists for the relations the AMS table lists |
\not prefix |
\not\equiv, \not\sim |
Works on a base relation without extra packages; slash is placed at a fixed location |
\centernot |
\centernot\parallel |
Centres the slash; needs the centernot package |
| Other symbol packages | \nequiv (txfonts/pxfonts) |
Lists more negations; check which package’s table includes the symbol you need |
FAQ
How do I write “does not equal” in LaTeX?
\neq in math mode, for example $x \neq y$.
How do I write “not equivalent” in LaTeX?
\not\equiv. The command \nequiv is not in the AMS symbol tables.
What is the gradient symbol in LaTeX?
\nabla (∇).
What is the difference between ≈ and ∼?
They are different symbols (\approx and \sim); their meaning is set by the convention you define in your text.
What does \( do in LaTeX?
It starts inline math mode, closed by \); Overleaf lists it alongside $...$ as a working inline delimiter.
For the related symbol families see LaTeX less-than and greater-than symbols, the proportional symbol in LaTeX and set intersection in LaTeX.
Sources
- Overleaf, “List of Greek letters and math symbols” (overleaf.com/learn/latex/List_of_Greek_letters_and_math_symbols), read 2026-11-07.
- Overleaf, “Mathematical expressions” (overleaf.com/learn/latex/Mathematical_expressions), read 2026-11-07.
- CTAN, The Comprehensive LaTeX Symbol List (symbols-a4.pdf, info/symbols/comprehensive), read 2026-11-07: Tables 131, 133, 137 and 401.
- CTAN,
centernotpackage documentation (centernot.dtx v1.4, 2016/05/16), read 2026-11-07. - CTAN, LaTeX Companion example sources (info/examples/tlc3, example 11-8-8), 2026-11-07.







