[Tex/LaTex] Theorems in a book

theorems

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

\documentclass[12pt]{book}

but after that I write

\begin{theom}

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

Best Answer

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:

\documentclass[12pt]{book}
\newtheorem{theorem}{Theorem}
\begin{document}
\chapter{First chapter}
\section{First section}
This is some text, with the following theorem.
\begin{theorem}
My first theorem. \label{mytheorem}
\end{theorem}
Theorem~\ref{mytheorem} is pretty awesome.
\end{document}

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:

\newtheorem{theorem}{Theorem}[chapter]

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.