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 am using enumitem to handle my enumerate and itemize lists. I have a list like

\begin{enumerate}[label=Step \arabic{enumi}.]
\item step the first \label{en:step-1}
\item el secundo \label{en:step-2}
\item item the third \label{en:step-3}
\end{enumerate}

When I cross-reference one of these items, the punctuation shows up in the document. For example,

Let us reference \ref{en:step-1}.

gives me

Let us reference Step1..

The regular enumerate or itemize environments don't have this problem; punctuation does not show up when cross-referencing.

In the enumitem documentation there is an option afterlabel but that is only for inline lists.

Is there an option in enumitem, or a way of using enumitem that adds the correct punctuation to the list, but lets me cross-reference the label without the punctuation?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Use the ref key:

\begin{enumerate}[label=Step \arabic{enumi}.,ref=Step \arabic{enumi}]
\item step the first \label{en:step-1}
\item el secundo \label{en:step-2}
\item item the third \label{en:step-3}
\end{enumerate}

A complete example:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=Step \arabic{enumi}.,ref=Step \arabic{enumi}]
\item step the first \label{en:step-1}
\item el secundo \label{en:step-2}
\item item the third \label{en:step-3}
\end{enumerate}
Let us reference \ref{en:step-1}.

\end{document}

enter image description here

share|improve this answer
    
thank you! cripes, I see it in the documentation now. –  Eric May 21 '12 at 5:09
add comment

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.