Subtraction in LaTeX (-)

−-
LaTeX command
-
Package
No package needed: built into LaTeX
Mode
Text and math mode
Copy the Unicode character
−U+2212

Where it is used

Subtracts one quantity from another; in math mode the hyphen key becomes a true minus sign, not a hyphen.

Inside math mode the hyphen character is converted into a proper minus sign, which is longer than a text hyphen and gets binary operator spacing in a - b. Outside math you only get a short hyphen, so a negative number in running text should still be written as $-5$ rather than typed bare. When the minus is unary, as in -x or e^{-t}, TeX removes the surrounding space automatically. Do not confuse it with \setminus, which denotes set difference A \setminus B, or with the en dash used for ranges. For a superscript minus, as in x^{-1} or Cl^-, braces are needed only when more than one character follows.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

f(x)=x3−2x2−x+2f(x) = x^3 - 2x^2 - x + 2
\documentclass{article}
\begin{document}
Subtraction: $-$

\[ f(x) = x^3 - 2x^2 - x + 2 \]
\end{document}

Related symbols

All 수학 기호 →

Frequently asked questions

How do I write Subtraction in LaTeX?
Type - in math mode, for example $f(x) = x^3 - 2x^2 - x + 2$. It works in plain LaTeX without loading any package.
Which package do I need for -?
None. - is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use - in text mode, or only in math mode?
Both. - compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기