You can do this easily with the enumitem
package.
The enumitem
package allows you to determine the numbering system for any level or all levels of a list class. In this example, I've used:
\setlist[enumerate,2]{label=\theenumi.\arabic*.,ref=\theenumi.\arabic*}
This means "set the label of the second level of enumerate
to be the label of the first level (\theenumi
) plus the arabic number representation of the current level (\arabic*
)."
Since you likely don't want a dot after the number in references, I've added a separate specification for references that excludes it. If you want to do this for other levels, you can add a format for each sublevel:
\setlist[enumerate,2]{label=\theenumi.\arabic*.,ref=\theenumi.\arabic*}
\setlist[enumerate,3]{label=\theenumii.\arabic*.,ref=\theenumii.\arabic*}
The toplevel counter is enumi
, the next level is enumii
, etc. The output representation of those counters is \theenumi
, \theenumii
, etc. So each definition has to refer to the representation of the counter of the previous level in its definition.
\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate,2]{label=\theenumi.\arabic*.,ref=\theenumi.\arabic*}
\begin{document}
\begin{enumerate}
\item First level item
\item First level item
\begin{enumerate}
\item Second level item
\item Second level item
\end{enumerate}
\end{enumerate}
\end{document}
