Domain in LaTeX (\text{dom}(f))
- LaTeX command
\text{dom}(f)- Package
- Add to your preamble:
\usepackage{amsmath} - Mode
- Text and math mode
Where it is used
Domain of f, the set of inputs on which the function is defined.
Convex analysis uses it heavily: \operatorname{dom} f = \{x \mid f(x) < \infty\} is the effective domain of an extended-valued convex function. \text{dom} prints upright but can pick up italics in a theorem environment and lacks operator spacing; \operatorname{dom} avoids both problems. In a signature f\colon A \to B, A is already the domain, so \text{dom}(f) is most useful when the domain is implicit or partial, as with unbounded operators on Hilbert spaces. Some texts use D(f) or D_f instead, so match the convention of your field.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amssymb,amsmath}
\begin{document}
Domain: $\text{dom}(f)$
\[ \text{dom}(f) = \{x \in \mathbb{R}^n \mid f(x) < \infty\} \]
\end{document}Related symbols
- Codomain
\text{cod}(f) - Kernel
\ker(f) - Range
\text{range}(f) - Image
\text{Im}(f) - Hook Right Arrow
\hookrightarrow - Inverse Function
f^{-1}
Frequently asked questions
- How do I write Domain in LaTeX?
- Type \text{dom}(f) in math mode, for example $\text{dom}(f) = \{x \in \mathbb{R}^n \mid f(x) < \infty\}$. Load amsmath first with \usepackage{amsmath}.
- Which package do I need for \text{dom}(f)?
- \text{dom}(f) needs amsmath: add \usepackage{amsmath} to your preamble before the document starts.
- Can I use \text{dom}(f) in text mode, or only in math mode?
- Both. \text{dom}(f) compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.