5

Possible Duplicate:
Can I re-use section labels across chapters?

Is there a way to control the scope of the command \label and \ref?

In document chap1.tex, I declare the label \label{lemma} and access it with \ref{lemma}.
In document chap2.tex, I also declare the label \label{lemma} and access it with \ref{lemma}.

Then, in book.tex, the error multiply defined label is raised.

I understand the error wouldn't be raised if I use \label{1:lemma} and \label{2:lemma}.

Is it possible to redefined the command label and ref so that \label{lemma} produces the key chap1:lemma, and \ref{lemma} invokes the key chap1:lemma.
That is label and ref based themselves on the current document name.

Any other solution is also welcome.

0 Answers0