4

I feel this is a really basic question, but I haven't figured out a solution after searching for half an hour so maybe other people will find this question useful as well.

I'm using the cleveref package for all my referencing needs. By default, when I reference say the first item of an enumerated list, the reference is displayed as item 1. However, I'd like the cross-reference name to be part, i.e. the reference should read part 1. I've been experimenting with the \crefname command, but

\crefname{item}{part}{parts}

doesn't do the trick. Does anyone know what I have to supply in the first argument to change the \crefname of items?

Here's a MWE to work with:

\documentclass{article}

\usepackage{enumitem}
\usepackage{cleveref}

\begin{document}

\begin{enumerate}
\item\label{item 1} Item 1.
\end{enumerate}

See \cref{item 1}.

\end{document}
  • Is that for a particular item, or do you want that part is associated to any reference to an enumerate item? – egreg Jul 12 '15 at 9:53
  • I want the name of every reference to an item to be part. – Casimir Jul 12 '15 at 10:02
9

cleveref use the counters as type. The counters of enumerate are enumi, enumii, enumiii enumiv: (I wouldn't use spaces in label names, so I removed it)

\documentclass{article}

\usepackage{enumitem}
\usepackage{cleveref}
\crefname{enumi}{part}{parts}
\begin{document}

\begin{enumerate}
\item\label{item1} Item 1.
\end{enumerate}

See \cref{item1}.

\end{document}
  • Damn it, why didn't I try that. :) Works great, thanks. – Casimir Jul 12 '15 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.