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.

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?

share|improve this question
    
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). Usually, we don't put a greeting or a "thank you" in our posts. –  Guido Jan 18 '13 at 5:31

1 Answer 1

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 enumerat allows you to set how the label and the reference to it are going to 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).

share|improve this answer

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.