Suppose I have a theorem that is defined a certain way, as follows.


And I want to redefine it another way further down in my document, as below.


What is the easiest way to go about this?

I would like something like this, but I get undefined control sequence on \renewtheorem.


\begin{thmTemp} First one.  \end{thmTemp}

\begin{thmTemp} Second one.  \end{thmTemp}

When I run pdflatex on this, I get the following:

! Undefined control sequence.
l.10     \renewtheorem

I am avoiding ntheorem because it does not preserve the theorem styles defined by amstheorem, even when the amsthm option is passed to it, and I would prefer not to redefine those styles.

  • Have you tried \renewtheorem? It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem. That way we would know which packages you are using as some solutions may be package specific. – Peter Grill Mar 18 '13 at 6:13
  • Try replacing amsthm with ntheorem. – Peter Grill Mar 18 '13 at 6:22
  • @PeterGrill, There's actually a specific reason I want to use amsthm and not ntheorem. I prefer not to redefine \theoremstyle{definition} among others. – merlin2011 Mar 18 '13 at 6:23
  • And yes, I have tried the [amsthm] option to ntheorem, but it does not achieve the desired effect. – merlin2011 Mar 18 '13 at 6:23
  • 1
    Perhaps it would help if you specified more closely what you mean by 'redefine it another way'... How do you expect the redefined theorem environment to behave? Do you simply want to change the heading and continue numbering with the previous counter? Or do you also want to change the style of the theorem? – bencarabelli Mar 18 '13 at 8:12

Rather than redefining the environment each time, I would define a wrapper:


First one.

Second one.

enter image description here


If one systematically needs different theorems definitions in the same documents, egreg approach is convenient. But many of us might have a mymath.tex with common shortcuts and settings, which is a very likely place for the \newtheorem definitions, and occasionally one might want to override these definitions, e.g. to change the theorems' locale.

In these cases, editing mymath.tex or mantaining a second one is inconvenient and prone to errors, much better to plug a new altthm.tex in the main document overriding theorem definitions.
To this end, we need a \renewtheorem command:

  \expandafter\let\csname c@#1\endcsname\relax

Use as the \renewtheorem as the standard \newtheorem:


It works with amsthm.

The MWE, excluding the \renewtheorem definition, is:


My theorem ...

My theorem ...

  • Please, do not tell me you submit papers using some sort of mymacros.tex. If you do, I truly hope I won't meet the papers. – yo' Feb 26 '16 at 22:30
  • 5
    @yo': Hmm... sorry to disappoint you, but LaTeX most relevant feature is macros, which avoid repetitive typing. Putting all of them in the preamble, or even worse in the body of text, creates clutter and defeats the whole purpose of LaTeX being focused on content, rather than presentation. Anyway, unless you are involved publishing a journal, you are not supposed to read the sources producing the papers. P.S. in case you might be interested, I fixed a bug in the code. – antonio Feb 27 '16 at 20:10
  • 3
    @yo' from your perspective, you are right. From the author perspective, you are absolutely wrong. But I understand that journal typesetting is the key part of Science. – Spherical Triangle Mar 1 '16 at 17:18
  • 1
    @antonio Can your trick be made to work with \newtheorem*{thm*} ? – Paulo Ney Apr 26 '16 at 6:31
  • 1
    Also, I know from experience that researchers who maintain a personal style file ends up with better (La)TeX code (easier to read, more accurate and elegant typesetting), which should in the end ease the work of publishers. The latter should actually take this into account before imposing class files loading packages known for conflicting with many others. – Hugo Raguet Feb 20 '18 at 3:02

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.