Defined As in LaTeX (:=)
- LaTeX command
:=- Package
- No package needed: built into LaTeX
- Mode
- Text and math mode
Where it is used
Colon-equals, the definition assignment: the left side is defined to equal the right side.
Writing f(x) := x^2 + 1 marks a definition rather than a claim of equality, and the colon sits on the side of the thing being defined (=: reverses the direction). Typed directly, the colon and equals sign are both relations, so TeX sets them without space between them, but the colon is not vertically centered on the equals sign, which bothers some typographers. The \coloneqq command from a math tools package fixes that alignment. In pseudocode it also denotes assignment, x := x + 1. Alternatives include \triangleq and \stackrel{\text{def}}{=}.
Also listed under: علوم الحاسوب
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Defined As: $:=$
\[ \|f\|_{\infty} := \sup_{x \in X} |f(x)| \]
\end{document}Related symbols
- Triangle Equal
\triangleq - Asymptotic
\asymp - Succeeds or Equal
\succeq - Precedes or Equal
\preceq - Succeeds
\succ - Precedes
\prec
Frequently asked questions
- How do I write Defined As in LaTeX?
- Type := in math mode, for example $\|f\|_{\infty} := \sup_{x \in X} |f(x)|$. 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.
أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf
يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي
- أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
- ارفع صورة وحولها إلى LaTeX بسلاسة
- احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث