Skip to content
latexci
PreviewDiffWord → LaTeXBibTeXSymbolsTableTemplatesAcademics
Sign inFree
PreviewDiffWord → LaTeXBibTeXSymbolsTableTemplatesAcademicsFree
Discord community ↗GitHub ↗
Sign in
LaTeX symbols›Operators›LCM

LCM in LaTeX

The LaTeX command for lcm is \operatorname{lcm} (least common multiple).

lcm⁡\operatorname{lcm}lcm
\operatorname{lcm}
Operators · needs amsmath

Writing a paper? The table generator and the BibTeX cleaner are one click away, no account.

Which command should you use?

CommandPackageUse it when
\operatorname{lcm}(a, b) recommendedamsmathUpright, with operator spacing.
\DeclareMathOperator{\lcm}{lcm} amsmath (preamble)In the preamble, then write \lcm(a, b).
\gcd(a, b) noneIts partner, which is built in.
Table 1. Ways to write lcm in LaTeX. Every line was compiled with pdfLaTeX (TeX Live 2026) loading only the package shown.
Common mistake. Unlike \gcd, standard LaTeX has no \lcm: it fails with "Undefined control sequence" until you declare it.

How to type LCM

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.

Example
$\operatorname{lcm}(4, 6) = 12$lcm⁡(4,6)=12\operatorname{lcm}(4, 6) = 12lcm(4,6)=12

Open this example in the live preview: it renders as you type, with no compiler and no signup.

Related Operators symbols

sgn\operatorname{sgn}tr\operatorname{tr}rank\operatorname{rank}diag\operatorname{diag}span\operatorname{span}argmax\operatorname*{argmax}argmin\operatorname*{argmin}sin\sincos\costan\tanarcsin\arcsinarccos\arccosarctan\arctansinh\sinh

Math operators in LaTeX: the full table or search all 350+ LaTeX symbols.

FAQ

How do you write lcm (lcm) in LaTeX?

Use \operatorname{lcm} in math mode after adding \usepackage{amsmath} to your preamble. For example, $\operatorname{lcm}(4, 6) = 12$.

Which package provides \operatorname{lcm}?

It comes from the amsmath package: add \usepackage{amsmath} to your preamble.

What is the most common mistake with lcm in LaTeX?

Unlike \gcd, standard LaTeX has no \lcm: it fails with "Undefined control sequence" until you declare it.

latexci

Free LaTeX tools for researchers and students, in any browser. No paid plan, no advertising.

Star on GitHubBuy me a coffee

Tools

Live PreviewBibTeX ToolsDOI → BibTeXarXiv → BibTeXPubMed → BibTeXISBN → BibTeXLaTeX DiffWord → LaTeXSymbol SearchTable GeneratorTemplatesCV Generator

Learn

Academics hubLife after OverleafFreeGitHub

Community

DiscordGitHub IssuesFeature Requests

© 2026 latexci. By Sitraka Forler, sitraka.lu

PrivacyTerms