# Customizing cross references with cleveref

I'm lost in the maze of customization options in the cleveref package. The MWE says what I'm trying to do, and my best attempt so far.

I'm running TeXLive 2013, compiling with latexmk -pdf MWE.tex

Note: I don't need a more sophisticated package than memoir's extensions to enumerate, unless that helps solve the problem.

\documentclass{memoir} \usepackage{hyperref} \usepackage{cleveref} \setsecnumdepth{subsubsection}  \begin{document} \mainmatter \chapter{one} \label{chap:one} \section{uno} \label{sec:uno} \subsection{ein} \label{subsec:ein}  \begin{enumerate}[(a)] \item aaa \item \label[subsection]{enum:bbb} bbb \end{enumerate}  \subsection{zwei}  What I want is a cross reference that looks like section 1.1.1(b)''  But \verb|\cref{enum:bbb}| gives \cref{enum:bbb}''  \end{document} 


Note: the comments and answer that suggest changing enumerate to subsubsection don't address the fact that I want the cross reference formatted differently from the section number in the document - as shown in the MWE, the numbering within the document should be just "(b)" but the reference should be "1.1.1(b)".

Replay

Perhaps using the enumitem package with shortlabels and the ref=.... option key is a by-pass solution.

\documentclass{memoir}
\usepackage[shortlabels]{enumitem}
\usepackage{hyperref}
\usepackage{cleveref}
\setsecnumdepth{subsubsection}

\begin{document}
\mainmatter
\chapter{one}
\label{chap:one}
\section{uno}
\label{sec:uno}
\subsection{ein}
\label{subsec:ein}

\begin{enumerate}[(a),ref={\thesubsection(\alph*)}]
\item
aaa \label{foo}
\item
\label[subsection]{enum:bbb}
bbb
\end{enumerate}

\subsection{zwei}

What I want is a cross reference that looks like section 1.1.1(b)''

But \verb|\cref{enum:bbb}| gives \cref{enum:bbb}''

\end{document}



Using in the preamble:

\renewcommand{\thesubsubsection}{\thesubsection.\alph{subsubsection}}



with

\subsubsection{aaa}
%       \item
aaa
\subsubsection{bbb}
\label[subsection]{enum:bbb}
bbb
%   \end{enumerate}



you get more or less what you want.

Category: hyperref Time: 2016-07-29 Views: 0