4

In the following situation

\begin{enumerate}

\item 

\begin{enumerate}

\item \label{ii}

\item

\end{enumerate}

\item

\end{enumerate}

Item \ref{ii}

I obtain in the output

  1. (a)

(b)

2.

Item 1a

I want, however, to obtain "Item (a)" (the reference should contain only the second-level item number, not the first level). How can I do it?

1

1 Answer 1

4

The enumitem package allows one to customise list environments and their parameters.

\begin{enumerate}
\item 
    \begin{enumerate}[label=(\alph*),ref=\alph*]
    \item \label{ii}
    \item
    \end{enumerate}
\item
\end{enumerate}

Item \ref{ii}

In the snippet above the argument of enumerate allows you to set how the label and the reference to it will be printed. It is possible to set the parameter globally. To set a parameter globally one can use the command

\setlist[list,level]{format}

where list is one of description, enumerate or itemize; or

\setlist[level]{format}

Thus for the case at hand

\setlist[enumerate,2]{ref=\alph*]

See the package documentation (texdoc enumitem).

0

You must log in to answer this question.

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