3

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?

6
  • 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. Dec 22, 2012 at 13:36
  • I don't know how to make a minimal working example ! I am using the enumitem package
    – Muhammad
    Dec 22, 2012 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}. Dec 22, 2012 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, 2012 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, 2012 at 14:02

1 Answer 1

6

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

1
  • @ Harish Kumar ... I already tried to vote but it requires at least 15 reputations and I have only 8 reputations!
    – Muhammad
    Dec 22, 2012 at 14:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .