3

In the code

\newtheorem{thm}{Theorem}[section]

what should stand in place of section to get continuous numbering (simply Theorem 1, Theorem 2, etc.) for the whole text?

7

The short answer is "nothing". In LaTeX [...] denotes an optional argument. For \newtheorem when this argument is not present, these environments are number continuously throughout the document:

Sample output

\documentclass{article}

\newtheorem{thm}{Theorem}

\begin{document}

\begin{thm}
  A theorem.
\end{thm}

\section{A section}
\label{sec:section}

\begin{thm}
  Another theorem.
\end{thm}

\end{document}

The command \newtheorem has another commonly used optional argument. Writing

\newtheorem{thm}{Theorem}
\newtheorem{cor}[thm]{Corollary}

will use the same counter for Theorems and Corrollaries, so that you get

Theorem 1
Theorem 2
Corollary 3
Theorem 4

instead of

Theorem 1
Theorem 2
Corollary 1
Theorem 3    

In long documents, numbering of the former type is the most helpful to the reader.

  • Thank you very much. This turns out to be the default option. – limanac Jan 29 '14 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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