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

I define a theorem style pretty innocuously, to get things looking a bit more like amsthm theorems. But - my \autoref{}s become messed up with optional arguments of theorem environments.



  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}
  {\item[\hskip\labelsep {\theorem@headerfont ##1\ ##2}{\normalfont\ (##3)}
   {\theorem@headerfont \theorem@separator}]}



The quick brown fox jumped over the lazy dog.

The second brown fox jumped over the second dog.

I want to refer to the two lemmata above, and should be getting
``Lemma 0.1'' and ``Lemma 0.2''. But autoref gives me ``Apple 0.1''
and ``Apple 0.2'': \autoref{lem:first} and \autoref{lem:second}.


And the output: output

Am I doing something wrong or is this an ntheorem bug? (using MikTex 2.9).

share|improve this question
up vote 7 down vote accepted

Hyperref mentions something to this effect in the package documentation (p 15). To avoid this, you can 'suggest' what \autoref should use by means of


Forcing \autoref to pick the right name

share|improve this answer
It works... I actually tried \providecommand* before, but without the star, so that didn't work. Thanks. – einpoklum Jul 31 '11 at 17:45

Load \usepackage[thref,hyperref]{ntheorem} and change the references into \thref{lem:first} and \thref{lem:second}.

\autoref is a hyperref command, so it might well collide with ntheorem's way of communicating information to the second compilation pass via the .aux and .thm files.

The adaptation towards hyperref is a kind of hack, as hyperref forces its definitions at \AtBeginDocument.

share|improve this answer
What's the benefit of using \thref in general? Or rather - where do I read about \thref vs \autoref ? Are they supposed to behave the same (specifically, does \thref create a clickable link in the PDF)? – einpoklum Sep 20 '11 at 6:30

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.