# How to create enumerate environment with item number in the format (i,j)?

\begin{enumerate}[(i)]
\item
\end{enumerate}


This gives the items with roman numbering. But I want to numbering in (i,j) format, i.e. I want my items numbered like (1,2),(1,1), (5,4) etc. What to do?

-
Wnat is i and what is j? What do they represent? –  Marco Daniel Feb 23 '13 at 14:50
@MarcoDaniel: natural numbers –  user31526 Feb 23 '13 at 14:50
With one list, why do you want two numbers? –  Paul Gaborit Feb 23 '13 at 15:02
Does \item[(i,j)] help? –  Hendrik Vogt Feb 23 '13 at 15:13
@user31526: To be more specific, does \item[(1,2)] ..., \item[(1,1)] ..., \item[(5,4)] ... help? Just "tell" the \item what numbering you want. –  Hendrik Vogt Feb 23 '13 at 15:24
show 5 more comments

The following MWE implements a (i) numbering/labeling system for first-level items and an (i,j) numbering/labeling system for second-level items. Here, i and j are arabic numerals.

\documentclass{article}
\renewcommand{\theenumi}{(\arabic{enumi})}
\renewcommand{\theenumii}{(\arabic{enumi},\arabic{enumii})}
\renewcommand{\labelenumi}{\theenumi}
\renewcommand{\labelenumii}{\theenumii}
\makeatletter
\renewcommand{\p@enumii}{}
\makeatother
\begin{document}
\begin{enumerate}
\item First level-one item
\begin{enumerate}
\item First level-two item
\item Second level-two item
\end{enumerate}
\item Second level-one item
\begin{enumerate}
\item Still another level-two item
\end{enumerate}
\end{enumerate}
\end{document}


• If you don't wish to adjust the labeling style of the first-level items, just comment out (or delete) the instructions that reset \theenumi and \labelenumi.
• The instruction \renewcommand{\p@enumii}{} is there to let level-2 items be cross-referenced using the usual \label and \ref method. Because it contains a "special" character (the @ symbol), the instruction has to be "wrapped" inside a pair of \makeatletter and \makeatother instructions.
-

I always like to use the enumitem package for anything list-related; perhaps it is overkill in this case, but here's one way that it can be done.

\setlist[enumerate,1]{label=(\arabic*)}
\setlist[enumerate,2]{label=(\arabic{enumi}{,}\arabic*)}


The 1 is for 'first-level', and the 2 is for 'second-level'.

MWE

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate,1]{label=(\arabic*)}
\setlist[enumerate,2]{label=(\arabic{enumi}{,}\arabic*)}

\begin{document}
\begin{enumerate}
\item First level-one item
\begin{enumerate}
\item First level-two item
\item Second level-two item
\end{enumerate}
\item Second level-one item
\begin{enumerate}
\item Still another level-two item
\end{enumerate}
\end{enumerate}
\end{document}

-