Hope the title is not too confusing and describes what I meant. Here is the thing: I need to have a list where the items have an incremental counter but also have some customized words attached. I.e., I want to have a list like:
Case 1 (a<b): XXX
Case 2 (b<c): YYY
Case 3 (c<d): ZZZ
where the '1', '2', and '3' are counters and I would like to reference them with proper hyperref. E.g, in other places, I may have something like:
In Case 1, we only need to do XXX.
where the '1' is not hardcoded and is derived from '\ref{SomeLabel}'. Furthermore, I would like the hyperref to work with the labels/refs.
Currently, I figured out a solution which displays correctly but the hyperref is not working properly. My solution is:
\documentclass{article}
\usepackage{hyperref}
\newcounter{desccounter}
\newcommand{\descitem}[1]{\refstepcounter{desccounter}\item[Case \thedesccounter{} #1]}
\begin{document}
The first list:
\setcounter{desccounter}{0}
\begin{description}
\descitem{$(a<b)$}:\label{Label1} XXX
\descitem{$(b<c)$}:\label{Label2} YYY
\descitem{$(c<d)$}:\label{Label3} ZZZ
\end{description}
Refs to the first list: Case \ref{Label1}, Case \ref{Label2}, Case \ref{Label3}.
\bigskip
The second list:
\setcounter{desccounter}{0}
\begin{description}
\descitem{$(x=y)$}:\label{Label4} AAA
\descitem{$(y=z)$}:\label{Label5} BBB
\descitem{$(z=w)$}:\label{Label6} CCC
\end{description}
Refs to the second list: Case \ref{Label4}, Case \ref{Label5}, Case \ref{Label6}.
\end{document}
And the rendered result is:
You can see that display is correct, but hyperref is not: If you click the hyper links for the second list, you will be directed to the first list.
Since I am not an expert in the counter/label/ref thing in Latex, any experts can help on this issue? Thanks!