The LaTeX command for lcm is \operatorname{lcm} (least common multiple).
\operatorname{lcm}Writing a paper? The table generator and the BibTeX cleaner are one click away, no account.
| Command | Package | Use it when |
|---|---|---|
\operatorname{lcm}(a, b) recommended | amsmath | Upright, with operator spacing. |
\DeclareMathOperator{\lcm}{lcm} | amsmath (preamble) | In the preamble, then write \lcm(a, b). |
\gcd(a, b) | none | Its partner, which is built in. |
Write \operatorname{lcm} inside math mode, that is between $…$ for inline math or in a \[ … \] or equation block for display math. This symbol needs the amsmath package, so add \usepackage{amsmath} to your preamble.
$\operatorname{lcm}(4, 6) = 12$Open this example in the live preview: it renders as you type, with no compiler and no signup.
\operatorname{sgn}\operatorname{tr}\operatorname{rank}\operatorname{diag}\operatorname{span}\operatorname*{argmax}\operatorname*{argmin}\sin\cos\tan\arcsin\arccos\arctan\sinhMath operators in LaTeX: the full table or search all 350+ LaTeX symbols.
Use \operatorname{lcm} in math mode after adding \usepackage{amsmath} to your preamble. For example, $\operatorname{lcm}(4, 6) = 12$.
It comes from the amsmath package: add \usepackage{amsmath} to your preamble.
Unlike \gcd, standard LaTeX has no \lcm: it fails with "Undefined control sequence" until you declare it.