0

I defined the labels of items from enumerate as following:

    1.\usepackage{enumerate}
    2.\renewcommand{\theenumi}{\arabic{enumi}}
    3.\renewcommand{\labelenumi}{\theenumi} 
    4.\renewcommand{\theenumii}{\arabic{enumii}}
    5.\renewcommand{\labelenumii}{\theenumi.~\theenumii}
    6.\renewcommand{\theenumiii}{\arabic{enumiii}}
    7.\renewcommand{\labelenumiii}{\theenumi.~\theenumii.~\theenumiii}

I can create the enumeration of items on three levels with dots:

1
1.1
1.1.1

I reference the item with the command \ref{item_label}

\item \label{item_label} item_text
In \ref{item_label} you can find ...

The numbers in enumeration have dots, but in the reference the dots are missing, although I defined them in lines 5 and 7.

1.1.1 item_text
In 111 you can find ...  

How can I have dots in the cross-references? I want to use only enumerate, and no other package.

2
  • Welcome to TeX.SX! There are better ways to achieve this (e.g. enumitem package) Please provide a working document, not just fragments
    – user31729
    Commented Jan 19, 2016 at 17:18
  • With the restriction of "no packages except for enumerate", I'm going to assume this is working as intended. From section 1 of the documentation, "In the above example \ref{LA}, \ref{LB} and \ref{LC} produce ‘i’, ‘iia’ and ‘1’ respectively." Note that the CTAN page for enumerate specifically recommends enumitem for other uses, too. Commented Jan 19, 2016 at 17:21

1 Answer 1

3

enter image description here

\documentclass{article}

\usepackage{enumerate}
   \renewcommand{\theenumi}{\arabic{enumi}}
   \renewcommand{\labelenumi}{\theenumi} 
   \renewcommand{\theenumii}{\arabic{enumii}}
   \renewcommand{\labelenumii}{\theenumi.~\theenumii}
   \renewcommand{\theenumiii}{\arabic{enumiii}}
   \renewcommand{\labelenumiii}{\theenumi.~\theenumii.~\theenumiii}

\makeatletter
\renewcommand\p@enumii{\theenumi.}
\renewcommand\p@enumiii{\theenumi.\theenumi.}
\makeatother

\begin{document}

\begin{enumerate}
\item xxx
\begin{enumerate}
\item xxx
\begin{enumerate}
\item xx \label{x}
\end{enumerate}
\end{enumerate}
\end{enumerate}

see [\ref{x}]

\end{document}

You must log in to answer this question.

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