Why does LaTeX have \newtherorem rather than define environments for theorem, lemma, etc.?

"Why" questions can always be answered in several different ways, not all giving consisent conclusions. A few, in no particular order.

  • Leslie Lamport did it that way in LaTeX 2.0x and we didn't change it in 2e.

  • latex + article class + amsmath with emtex left 50 command names left before the hash table was full and you could have no more definitions or \label or \cite etc. LaTeX2e is really the size it is because of this constraint.

  • This is the wrong question: LaTeX (the format) does not define many document level commands or environments, it does not define figure or table or \section. The model was (is) that the format defines the commands to build such structures, and that specific document classes would define the ones they needed. So the question is really "Why doesn't the article class define a theorem environment?"

  • There really is a lot of variation in theorems, both in the layout and in the markup required, do you just need theorem or do you also need corollary and lemma and proof for example. You could argue that the standard classes could have had a simple version leading to a consistent document markup and better cross document class compatibility but it isn't clear that is the case. They try that with \author/\title/\maketitle but most journal classes re-write that anyway with more structured author commands, so moving documents between journal classes still often means adjusting that markup. Conversely because theorem environments do have their definitions within the document, they are more likley to transfer between document classes without requiring change to the markup of each theorem.


Some LaTeX packages do provide built-in definitions for theorem, definition, etc. I initially assumed you were asking about the amsthm and ntheorem packages, but Don Hosek corrected me: there is a \newtheorem command in the LaTeX kernel.

Even if you have a long list of default definitions, you would still want the building blocks that let you define your own. Different authors will want different environments (for example, in different languages), and different publishers would have different house styles. And the code to define a new environment from an existing template is a single line.

So I imagine the authors of amsthm and ntheorem figured that each publisher would define those environments according to their own house style, in their own package, and they themselves would provide only the building blocks to make those as easy to define as possible.

Tags:

Theorems