TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to write a theorem in the format of a book. So I write


but after that I write


and it does not compile. Can someone please help me write a theorem in a book?

share|improve this question
We need a miminal example. Have you defined theom by a command or did you import it from some package? – JF Meier Oct 4 '11 at 7:34
If you search this site for theorem, you'll get a lot of relevant results. – cmhughes Oct 4 '11 at 14:41

As a start, I would suggest reading The Not So Short Introduction to LATEX2ε. It will give some idea of what LaTeX is all about and how to format a regular document.

Specific to your question, here is a small sample of what you might be after:

\chapter{First chapter}
\section{First section}
This is some text, with the following theorem.
My first theorem. \label{mytheorem}
Theorem~\ref{mytheorem} is pretty awesome.

Compiling this twice (to allow for appropriate referencing), you obtain:

My first theorem

If you're interested in numbering your theorem differently (say, having it reset with every \chapter and have the chapter number form part of the theorem number, as in chapter.theorem), you could use:


The command breakdown as well as the meaning of the parameters is available from "Help with \newtheorem".

Specific theorem-formatting packages (like ntheorem or amsthm, say) are also available that might be of help. However, this depends on exactly what kind of formatting you're after.

share|improve this answer
Very nice answer! – Juan A. Navarro Oct 4 '11 at 11:28
@Werner: Why did you define the counter theorem? – Marco Daniel Oct 4 '11 at 17:22
@Marco: Arg... that was not needed. Another instinctive measure when dealing with numbered stuff. With no complaint of an already defined counter theorem, I assumed it was necessary. I've removed it from my MWE. – Werner Oct 4 '11 at 17:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.