Generalhelp with references

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
wbm
Posts: 2
Joined: Wed May 07, 2008 11:29 pm

help with references

Post by wbm »

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...

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Post by Stefan Kottwitz »

Hi wbm,

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
wbm
Posts: 2
Joined: Wed May 07, 2008 11:29 pm

Re: help with references

Post by wbm »

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
Post Reply