Given a bunch of paragraphs:
Para. A ...
Para. B ...
Para. C ...
How can one have LaTeX automatically number them, i.e.
1. Para. A. ...
2. Para. B. ...
3. Para. C. ...
I've seen the following suggested:
\newcounter{parnum}
\newcommand{\N}{%
\noindent\refstepcounter{parnum}%
\makebox[\parindent][l]{\textbf{\arabic{parnum}.}}}
% Use a generous paragraph indent so numbers can be fit inside the
% indentation space.
\setlength{\parindent}{2em}
From here: comp.text.tex: Re: How do I number paragraphs in LaTeX?
Then use \N in front of every paragraph-to-be-numbered, i.e.
\N Para. A. ...
\N Para. B. ...
\N Para. C. ...
I've also seen references to Sarovar and numberpar, but both are referred to as "unstable" or "unpredictable", and things like "randomly breaks", which makes me wary.
I'd like some input on what may be the best course of action, here, and I think it's a topic worth some discussion.
Thank you for your interest and attention to this.
EDIT: I've tried the following
\begin{enumerate}
\item Para No. 1
\item Para No. 2
...
\end{enumerate}
However it results in typesetting problems, notably because I am interspersing section headings ala.
\begin{enumerate}
\item Para No. 1
\item Para No. 2
\section{Part II}
\item Para No. 5
\item Para No. 6
...
\end{enumerate}
and the section heading "Part II" will sometimes end up at the very bottom of the page (i.e. it doesn't keep with the following text).
I think there are three possible solutions (at least!) which don't involve rolling your own or someone else's macro, depending on exactly what you are trying to do.
1 If the numbering is required throughout the document, use \paragraph
, which is a lower-level sectioning command (like \chapter, \section, \subsection, etc.)
See the LaTeX wikibook for more information.
\setcounter{secnumdepth}{5}
...
\paragraph{If we want to} do something ...
(You may find this overkill/ugly, because it needs a properly nested structure of sections and subsections not to be)
Note that if your using the memoir document class (which I recommend unhesitatingly), the \setcounter
line becomes \maxsecnumdepth{paragraph}
2 If it's just a small piece, use a list:
\begin{enumerate}
\item Para No. 1
\item Para No. 2
...
\end{enumerate}
3 Or a generalized list (\begin{list}...\end{list{}
) if you want to tweak the formatting. I haven't immediately been able to find a good online reference for this, other than the piece in A Guide to LaTeX