2

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.

lockstep
  • 250,273
Tarion
  • 181

3 Answers3

5

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}!
egreg
  • 1,121,712
3

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

enter image description here

\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?

Werner
  • 603,163
0

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

\begin{equation}
A = B + C
\end{equation}

%% 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.

Tarion
  • 181