# Enumerate content and reference the numbers

I'm looking for a solution to enumerate paragraphs in my appendix and reference the numbers. I don't want to use sections for it and the enumerate environment seems unfeasible.

In my case I have around 40 statements that I want to enumerate and each statement has some describing text and formulas.

-
Why is using the enumerate environment unfeasible? –  Ian Thompson Jun 18 '12 at 19:12
isn't it more for smaller content like lists? –  Tarion Jun 18 '12 at 19:13
What goes wrong if you use it for this? –  Ian Thompson Jun 18 '12 at 19:14
You can use subsection or subsubsection or paragraph –  Marco Daniel Jun 18 '12 at 19:16
I am not really sure what you are exactly asking but if you just want to number paragraphs the easiest solution is just with the \setcounter{secnumdepth}{4} but that then \paragraph{example} becomes 1.1.1.1 example –  Rick de Groot Jun 18 '12 at 19:17

Without a specific example I can only provide general help. One case of this is covered here where the author would like to number different 'phases'. The code boils down to:

\newcounter{phase} \setcounter{phase}{0}
\renewcommand{\thephase}{\Roman{phase}}
\newcommand{\phase}[1]{%
\refstepcounter{phase}%
\textbf{Phase} \thephase: \texttt{#1}
}

\phase{blah}\label{pha:foo}
Look, Mom, a reference to \ref{pha:foo}!

-
There are some problems with your code: the \label will produce two spaces in output. –  egreg Jun 18 '12 at 22:46
Thanks for the correction! –  Alex Hirzel Jun 19 '12 at 0:04

It is possible to re-purpose \paragraph for this using the following:

\documentclass{article}
\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\makeatother
\renewcommand{\theparagraph}{\arabic{paragraph}}
\setcounter{secnumdepth}{4}% Allow up to \paragraph enumeration
\begin{document}
\section{A section} Here is some text.
\paragraph{Some text} Here is some more text.
\paragraph{} Here is some final text.
\end{document}


Setting secnumdepth to 4 allows for "level 4" sectioning commands to be numbered (which holds for \paragraph). More detail on the possible changes:

• \z@ (0pt) refers to the indentation from the left margin;
• 3.25ex... refers to the space (and glue) inserted before the heading;
• -1em refers to the space after the heading. If its negative, no line break will occur, while a positive length inserts a vertical skip;
• \normalfont... refers to the font of the \paragraph argument.

You can modify it to avoid using an argument by including it as part of the definition. For more information on \@startsection, see Where can I find help files or documentation for commands like \@startsection for LaTeX?

-

This is my solution:

\usepackage{enumitem}

\renewcommand{\labelenumi}{\textbf{Specification \arabic{enumi}: }}

\begin{enumerate}[leftmargin=0cm,itemindent=.5cm,labelwidth=\itemindent,labelsep=0cm,align=left]

\item XY mus hold

Some explanation

$$A = B + C$$

%% Next item ...

\end{enumerate}


Because I splitted the items into several files I use resume to continue my enumeration:

\begin{enumerate}[resume, leftmargin=0cm,itemindent=.5cm,labelwidth=\itemindent,labelsep=0cm,align=left]

\end{enumerate}


With this I can reference formulas and equations everywhere in my document.

-