Tell me more ×
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've got the following problem. I redefined the \labelenumi command to get an alphabetic first-order enumeration. If I label an item in this enumeration and generate a reference to it, the number of the item and not the modified label.

A minimal example:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8x]{inputenc}
\renewcommand{\labelenumi}{\alph{enumi}.)}

\begin{document}
\begin{enumerate}
 \item\label{part1} This is the first part. 
 \item We have seen in~\ref{part1}, that this does not work.
\end{enumerate}


\end{document}

gives:

   a.) This is the first part.
   b.) We have seen in 1, that this does not work.

What needs to be refined that \ref prints the character and not the number?

share|improve this question

2 Answers

up vote 5 down vote accepted

A bare-bones solution is to redefine \theenumi (and, if desired, \labelenumi on top of that).

\documentclass{article}

\renewcommand{\theenumi}{\alph{enumi}}
\renewcommand{\labelenumi}{\theenumi)}

\begin{document}

\begin{enumerate}
 \item\label{part1} This is the first part. 
 \item We have seen in~\ref{part1} that this does not work.
\end{enumerate}

\end{document}

enter image description here

share|improve this answer

Whenever you're customizing a list, the enumitem is your best friend.

In the code below I've used the \setlist command to customize the enumerate environment. In particular, I've changed the label using

label*=\alph*)

which changes the label to a), b), etc. I've also changed the ref using

ref=\alph*

which means that when you reference it you'll get a, b, c without the parenthesis. If you don't specify a format for ref then it simply inherits the format specified by label.

You can, of course, customize this as you see fit.

screenshot

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate]{label*=\alph*),ref=\alph*}

\begin{document}
\begin{enumerate}
 \item\label{part1} This is the first part. 
 \item We have seen in~\ref{part1}, that this does not work.
\end{enumerate}


\end{document}
share|improve this answer
Unfortunately, your minimal example/solution did not work. – Grisu Sep 10 '12 at 15:57
1  
@Grisu sounds like an update is in order – cmhughes Sep 10 '12 at 16:02

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.