3

In latex, when I'm trying to cross reference an item from an enumerated list, instead of getting 6.3, I'm getting 66.3,

My list is a normal list just like any other, only I'm declaring the codes below in my preamble:

\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}
4

I would kindly advise against such definitions since is a far more convenient and useful alternative in enumitem:

enter image description here

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\begin{enumerate}[label=\arabic*.,ref=\arabic*]
  \item Some item
  \begin{enumerate}[label*=\arabic*.,ref=\theenumi.\arabic*]
    \item Another item \label{myitem}
    \item Yet another item
  \end{enumerate}
\end{enumerate}
See Item~\ref{myitem}.
\end{document}

Note that different label and ref key-values are supplied, since the former includes a trailing period . that you don't want to include in the latter. Using label* inherits the label from the higher level in the nested environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.