15

I'd like to be able to reference a nested enumerated list item only by its inner-most identifying character.

\begin{enumerate}[(1)]
\item
  \begin{enumerate}[(a)]
    \item \label{mylabel} Referenced point.
  \end{enumerate}
\end{enumerate}
...
\ref{mylabel}

The \ref above gives me something like 1a, but I want it to give me a only.

14

In LaTeX, internal macro \p@enumN\theenumN defines the output of a \ref command. (ref. source2e) The default definitions in standard document classes are (ref. classes):

\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}

You can redefine \p@enumii to get what you want:

\makeatletter % for internal macros with @
\renewcommand\p@enumii{}
\makeatother

It seems you are using enumerate package to change the label. However, enumerate doesn't handle the cross references well. I suggest a more modern package enumitem to replace enumerate, which can also ease the problem using key-value syntax. For example:

% \usepackage{enumitem} % in preamble
\begin{enumerate}[label=(\arabic*)]
\item
  \begin{enumerate}[label=(\alph*),ref=\alph*]
    \item \label{mylabel} Referenced point.
  \end{enumerate}
\end{enumerate}

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.