Is there a way for labels to know what type of environment they were put in, so that when I reference a label it can say "Theorem 2.1" instead of just 2.1?
It seems like a hack to explicitly write "Theorem \ref{some-label}" since I might later change a theorem to a proposition or something else.
Thanks for any help...
General ⇒ help with references
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
help with references
Hi wbm,
welcome to the LaTeX Community board!
With ntheorem you could use \thref. In general the cleveref package could answer your question.
Stefan
welcome to the LaTeX Community board!
With ntheorem you could use \thref. In general the cleveref package could answer your question.
Stefan
LaTeX.org admin
Re: help with references
hi, thank you for the quick reply.
i have installed the package and started using. it is exactly what I need, but I have two questions.
first, it seems that it determines the labeling scheme from the counter. so I used to set up environments for theorem and corollary with
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
I did this because I wanted to have theorems and corollaries to be numbered sequentially (theorem 2.1, corollary 2.2, theorem 2.3) rather than theorems and corollaries have their own counter.
however, this will not work with cleveref since it would label all theorems and corollaries with the same thing.
is there a way around this, or just I just accept that theorems and corollaries will have their own counter?
Also, it doesn't seem to work with the environment \begin{equation} ... \end{equation}. Do you know how I can get it to work with this?
thanks
i have installed the package and started using. it is exactly what I need, but I have two questions.
first, it seems that it determines the labeling scheme from the counter. so I used to set up environments for theorem and corollary with
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
I did this because I wanted to have theorems and corollaries to be numbered sequentially (theorem 2.1, corollary 2.2, theorem 2.3) rather than theorems and corollaries have their own counter.
however, this will not work with cleveref since it would label all theorems and corollaries with the same thing.
is there a way around this, or just I just accept that theorems and corollaries will have their own counter?
Also, it doesn't seem to work with the environment \begin{equation} ... \end{equation}. Do you know how I can get it to work with this?
thanks