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 example, when I refer the enumerate level 2, it comes out 2a instead of 2 (a). How can I change that?

\begin{document}

\maketitle

\begin{abstract}

\end{abstract}

\section{}

\begin{enumerate}
 \item Iadfagas
 \item adf 
\begin{enumerate}
 \item \label{item:a} af a
 \item \label{item:aa} asd
 \item \label{item:b} asfa
 \item \label{item:c} af a
\end{enumerate}
\end{enumerate}


\ref{item:a} follows from Proposition
\end{document}
share|improve this question

2 Answers 2

With enumitem package, you can use:

\usepackage{enumitem}
\setlist[enumerate,2]{ref=\theenumi(\alph*)}
\setlist[enumerate,3]{ref=\theenumii\roman*}

MWE:

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate,2]{ref=\theenumi(\alph*)}
\setlist[enumerate,3]{ref=\theenumii\roman*}

\begin{document}

%\maketitle

\begin{abstract}

\end{abstract}

\section{}

\begin{enumerate}
 \item Iadfagas
 \item adf
\begin{enumerate}
 \item \label{item:a} af a
 \item \label{item:aa} asd
 \item \label{item:b} asfa
 \item \label{item:c} af a
\end{enumerate}
\end{enumerate}


\ref{item:a} follows from Proposition
\end{document}

enter image description here

As pointed out by Gonzalo, you may wish to modify the \ref for third level also by adding

\setlist[enumerate,3]{ref=\theenumii\roman*}

to get rid of the extra parenthesis in referring to an item in that level.

share|improve this answer

Without any packages:

\documentclass{article}

\makeatletter
\renewcommand\theenumii{(\alph{enumii})}
\renewcommand\labelenumii{(\alph{enumii})}
\renewcommand\p@enumiii{\theenumi\theenumii}
\makeatother

\begin{document}

\begin{enumerate}
 \item Iadfagas
 \item adf 
\begin{enumerate}
 \item \label{item:a} af a
 \item \label{item:aa} asd
 \item \label{item:b} asfa
 \item \label{item:c} af a
\end{enumerate}
\end{enumerate}


\ref{item:a} follows from Proposition
\end{document}

enter image description here

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.