Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 10 down vote accepted

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}
share|improve this answer
    
Both suggestions work for me. Thanks! –  Isaac Sutherland Jan 16 '11 at 2:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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