4

I have defined an enumerate environment with custom item names: each item should start with a bullet point and then "Type X case", where the X denotes the item number.

Later in the text, I want to refer to an item in the list, but only by its number: for instance, I want to write "we now refer to case X" (where X should include a hyperlink to the relevant list item).

MWE:

\documentclass{report}
\usepackage[shortlabels]{enumitem}
\usepackage{hyperref}
\begin{document}
\begin{enumerate}[label=$\bullet\;$\textit{Type \arabic* case}:]
        \item \label{item:type1case} If blah blah
        \item \label{item:type2case} If instead blah
        \item \label{item:type3case} this blah
\end{enumerate}

We now refer to case \ref*{item:type1case}...
\end{document}

The final result (in the last phrase) is something like "We now refer to case • Type 1 case:..." but I want to have instead "We now refer to case 1:..."

How to do this using enumitem package and (possibly) without having to load other packages?

1
  • In essence, you want to have a different \ref to what is printed in the label. Possible duplicate: Unbold referenced label
    – Werner
    Oct 19, 2018 at 20:50

1 Answer 1

5

enumitem knows the ref option to customise the appearance of labels

\documentclass{report}
\usepackage[shortlabels]{enumitem}
\usepackage{hyperref}
\begin{document}
\begin{enumerate}[label=$\bullet\;$\textit{Type \arabic* case}:,ref=case \arabic*:]
        \item \label{item:type1case} If blah blah
        \item \label{item:type2case} If instead blah
        \item \label{item:type3case} this blah
\end{enumerate}

We now refer to case \ref*{item:type1case}...
\end{document}

We now refer to case case 1:...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .