# Why is \lcm not defined as default?

Using only a class (report for example) we can use \gcd. But \lcm is not defined. Why?

\documentclass{report}
\begin{document}
$\lcm$
\end{document}


Why new distributions of TeX Live or MiKTeX don't have this command defined?

• Because it's not LaTeX. For some reason LaTeX (Lamport) does provide \gcd but not \lcm. As @ryan-reich explains you can define your own math operators or include a package that defines them.
– user10274
May 3 '13 at 5:26

I've often wondered why some symbol or operator doesn't have a name, when it seems to be so common in my papers ("Hom" being the big offender...who doesn't use this?!). The fact is, however, that there are practically an enormous number and potentially an infinite number of mathematical operator names, and as David Carlisle observes in his answer, at the time that the basic math package (amsmath and its siblings) was written, the number of macro names was a crucial issue, with far tighter constraints than you'd believe in these times.

Another comment on this situation is that neither MikTeX nor TeX Live actually alters the source code of the packages they distribute. They do provide package managers, binary executables of TeX and various related programs, and possibly scripts to automate them (MikTeX seems to have a download-on-demand feature built into its "tex", for example). But they don't dig into the packages, because that would violate the LPPL under which most of these packages are released.

That said, you might still feel some righteous indignation that they didn't choose your favorite operator name (again, name me a field of math that doesn't use "Hom"!). The fact is that your symbol isn't as important as you think it is (answer: calculus. Most of the pre-defined symbols are weighted heavily towards math up to the level of first- or second-year undergraduate education).

Finally, there's no big problem with space these days, and you can simply write

% \usepackage{amsmath}
\DeclareMathOperator{\lcm}{lcm}


at the beginning of your document. In fact, when you get enough of these you'll probably do as I have, and collect all such definitions into a file called, say, "mymath.tex", which you include with \input{mymath} all the time, and slowly forget what is and is not actually standard.

• the origin of the "basic" list of operator names was knuth's need for them in his books in the series "the art of computer programming"; these are defined in plain.tex, and a few more in manmac.tex. the additions defined in amsopn.sty were those most frequently called for in publications of the american math society. actually, \hom (lowercase) is included in the amsopn collection; i'm not knowledgeable enough to know the difference between "hom" and "Hom". May 3 '13 at 13:52
• @barbara Oh, you're right. I'm sure I noticed \hom in the past, but probably wanted the capital H and eventually forgot. One that really is missing is im, for image (goes with \ker, right?) May 3 '13 at 14:23
• as i mentioned, i'm not a mathematician. (tried; didn't succeed; ended up in linguistics and publishing-related pursuits with a "math flavor".) so i do recognize that \Im (imaginary, but a symbol, not an operator name) is not the same as "image", but don't have the notion instilled that "image" and "kernel" are siblings. i guess i'll have to expand my reading. May 3 '13 at 14:39
• People, nice discussion. I understand and I agree that there are many missing symbols. But my question is based on the fact that gcd is there and it is close related with lcm as much as ker is related with im. It is strange since is almost sure that if we use gcd we shall use lcm also. May 3 '13 at 22:25
• @Sigur And if we use ker we will almost certainly use im; nonetheless, neither \lcm nor \im is defined, and \hom is defined differently than the convention I learned. The point is that the symbols in the AMS packages were designed under limitations a long time ago, and are not being redesigned, but that there are many extension packages or commands you can use to get the symbol you want. May 3 '13 at 22:32