Saturday, 17 August 2013

enumitem: referencing items in enumerate

enumitem: referencing items in enumerate

Say we have a huge document with many sections, subsections, and
subsubsections. In a few of these sections, we have enumerated
environments.
The package I am using is enumitem.
One of the environments could look like:
\begin{enumerate}
\item \label{one}
\item
\end{enumerate}
referring back to \cref{one}
Now if I reference this item later, it will say:
referring back to item 1
I could have other enumerated environments with \alph, (\alph), etc. and
there reference could be item (a) or something.
The problem I have is what if I have another environment with the standard
numbers that starts from 1 and goes to 4 but item 1 is also labeled. I
would have another item 1 reference in the document. The hyperref would
take it to a different list but is there a way to differentiate the
printed out reference?
The list are unrelated so I don't want to start the new environment
continuing the old numbering. Say starting from 3 and so on.
Here is a MWE:
\documentclass{article}
\usepackage{enumitem}
\usepackage{cleveref}
\begin{document}
\begin{enumerate}
\item
one \label{one}
\item
two \label{two}
\end{enumerate}
This \cref{two} is great.
\begin{enumerate}
\item
one \label{dog}
\item
two \label{cat}
\end{enumerate}
This \cref{cat} is a cat.
\end{document}

Would there be a way to change one of the references to observation 1
instead of item 1? This would be a local change nor global.

No comments:

Post a Comment