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 have a problem when applying the ref command to refer to an item in a numerical list.

Here is an example for my problem:

My list style make the list appear as : 1. , 2. , 3.

I put a dot after the number of the item

When I refer to any item in the list, the dot appears with the number of the item.

The question is that how to omit the dot after the number in cross-referencing?

share|improve this question
    
Can you please add a minimal working example (MWE) that demonstrates the problem? This does not happen with a normal enumerate in a document with the article class. –  Torbjørn T. Dec 22 '12 at 13:36
    
I don't know how to make a minimal working example ! I am using the enumitem package –  Muhammad Dec 22 '12 at 13:47
1  
If you follow the link, there is some information about how to prepare one. Basically, an MWE is a document where you remove everything (packages, newcommands, content etc.) that doesn't have an influence on the problem, but it should still be possible to compile. So it should start with \documentclass, then include any related packages and customizations, then \begin{document}, a short list, and a cross reference to an item in the list, where the dot should appear. And finally an \end{document}. –  Torbjørn T. Dec 22 '12 at 13:56
    
First, I really want to thank you for your help :) Second, I have solved my problem :) ... I am using the "enumitem" package and I have found the solution of my problem by reading the package documentation. –  Muhammad Dec 22 '12 at 14:00
    
Here is an example to change the way in which the "ref" command appear in your text when you refer to an item in a list: \begin{enumerate}[label=\emph{\alph*}),ref=\emph{\alph*}] ... This remove the right parenthesis when referring to the item –  Muhammad Dec 22 '12 at 14:02

1 Answer 1

up vote 5 down vote accepted

You can use ref=\arabic* without a dot in

\setlist[enumerate]{label=\arabic*.,ref=\arabic*}

\def\MWE{

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

\begin{document}
\begin{enumerate}
  \item First item
  \item Second item \label{enu:second}
  \item Third item
\end{enumerate}
According to item~\ref{enu:second} I can't tell anything about your problem!
\end{document}

}

enter image description here

share|improve this answer
    
Thank you very much :) –  Muhammad Dec 22 '12 at 14:04
    
@ Harish Kumar ... I already tried to vote but it requires at least 15 reputations and I have only 8 reputations! –  Muhammad Dec 22 '12 at 14:35

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.