# Label a complete enumeration

I am trying to create a simple enumeration and give it a label so I can access it. But the only thing I get in return is the number of the subsubsection. This is my code, which doesn't seem to work.

\begin{enumerate}
\label{eq_prm_1}

\item bla
\item moreBla

\end{enumerate}


Is it possible to encapsulate this piece in something that is referenceable?

-
What do you expect to get? The enumerate doesnt have a caption, nor is it numbered, so what would you like a \ref to produce? –  Roelof Spijker Oct 21 '11 at 14:07
Yes I think you are right. I am looking for a way to simply number a list and create a caption underneath it and then reference to it. I thought that enumerate would be a good idea. –  Marnix Oct 21 '11 at 14:24

It sounds as if what you want is like another kind of float, like a figure or table, except for it not necessarily to "float". Fortunately, the float package can do that for you.

\usepackage{float}
\newfloat{lablist}{H}{lol}
\floatname{lablist}{List}


The above (in a preamble) defines a new floating environment, lablist, which is by default always placed exactly where it occurs in the source text (which is what the H does), and which are labelled by List n: in the captions. You can then do whatever you want in those environments, such as use an enumerated list.

Example.

\documentclass{article}

\usepackage{multicol}
\usepackage{float}
\newfloat{lablist}{H}{lol}
\floatname{lablist}{List}

\begin{document}

The following are the names of the digits in the Indo-Arabic numeral system, in English:
\begin{lablist}
\setlength\columnseprule{0.3pt}
\begin{multicols}{5}
\begin{enumerate}
\item zero  \item one  \item two    \item three  \item four
\item five  \item six  \item seven  \item eight  \item nine
\end{enumerate}
\end{multicols}
\caption{foo}
\label{list:foo}
\end{lablist}
\noindent
Refer to List~\ref{list:foo} whenever confused about the English names of numerals.

\end{document}


-
Yes, it seems that this is what I am looking for! –  Marnix Oct 21 '11 at 16:26

You could encapsulate it in another enumerate environment:

\begin{enumerate}
\item \label{eq_prm_1}
\begin{enumerate}
\item bla
\item moreBla
\end{enumerate}
\end{enumerate}


To make it more sophisticated you should style the outer enumerate so that it's label looks different and so that it's label is counted up every time it's used. This can be done with the package enumitem. It's often encouraged to use semantic commands and therefore we define a environment based off of enumerate which we call refenum (for enumerated references) and stick every list we want to reference into that environment.

\documentclass{article}

\usepackage{enumitem}
\usepackage{blindtext}

\newlist{refenum}{enumerate}{1}
\setlist[refenum]{label=(\arabic*),resume}

\usepackage{enumerate}

\begin{document}

\blindtext[1]
\begin{refenum}
\item \label{eq_prm_1}
\begin{enumerate}
\item bla
\item more bla
\end{enumerate}
\end{refenum}
\blindtext[1]
\begin{refenum}
\item \label{eq_prm_2}
\begin{enumerate}
\item bla
\item more bla
\end{enumerate}
\end{refenum}
Compare list~\ref{eq_prm_1} and~\ref{eq_prm_2}.

\end{document}


-
Yes, this does indeed solve what I mentioned in my question, but it does not solve what I am looking for. See my comment underneath my question to see what I am looking for, but I will need to accept your answer. –  Marnix Oct 21 '11 at 14:25

With my comment and your comment to that in mind as well as your original question, I suggest you take a look at the float package. It allows you to create a new float with caption to wrap your enumerate in.

-