TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

This one should be easy for the gurus…

Suppose I want to define a theorem environment which has a custom numbering scheme. That is, instead of being numbered according to some counter, it is numbered according to a passed parameter. So writing something like

\end{custom theorem}

would produce

Theorem 8. Text.

I realize I could define a new environment on my own, but then the header will be bold, or small caps, or whatever I defined it to be, and so may differ from the rest of the document if I switch documentclass. So I would like something that also matches the regular theorem headers.

Thanks in advance for any ideas.

share|improve this question
up vote 26 down vote accepted

An easy way is

%\usepackage{amsthm} %% uncomment to see the difference


Every theorem must be numbered by hand.

Here is a reference to theorem~\ref{eight}.

You can also use the optional argument for attribution:

share|improve this answer
I guess that's simpler than mine (and allows non numeric values too) – David Carlisle May 1 '12 at 16:48
@DavidCarlisle Yes, it uses the fact that innercustomthm is stepped, so the reference is established, but \theinnercustomthm is used, which can contain anything (well, almost). – egreg May 1 '12 at 16:50
This is splendid. Thanks so much. @DavidCarlisle: I went with egreg's, because it's simpler, but thanks also! – Skeptic May 1 '12 at 17:06
I am interested in an extension of this behavior. Let's say I want to create a theorem with the same label as a previous theorem. I would like to display this as \begin{customthm}{\ref{oldtheorem}}\end{customthm}, but this gives me errors. How would I modify this code to achieve the desired result? – Jonathan Gleason Aug 10 '12 at 15:20
The optional argument form did not work for me (I'm using amsthm). I fixed this with \newenvironment{customthm}[2][]{\renewcommand\theinnercustomthm{#2}\innercustom‌​thm[#1]}{\endinnercustomthm}. – equaeghe Mar 7 '14 at 15:42

You can just temporarily reset your theorem counter:




   \global\c@Theorem#1 %



Dummy text

Dummy text

Dummy text

share|improve this answer

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.