[Tex/LaTex] Numbered paragraphs without using \paragraph

numberingparagraphs

I would like to get numbered paragraphs. However, I'm in the process of "retro-fitting" quite a long document and inserting \paragraph (or any other command) every time would be very painstaking.

The topic has already been addressed multiple times here, but they all seem to rely on using the explicit \paragraph command (or another command that I would have to insert manually). See for instance this suggested solution case, marked as duplicate to my issue by other users; I don't think this works in my case, since the suggested solution relies on manually inserting a command at the beginning of every paragraph.

Is there way to make this happen without the use of an explicit command at the beginning of every paragraph?

I'd like this:

\documentclass{article}
\begin{document}
\title{My Title}
\author{Author's name}
\maketitle

First paragraph.

Another paragraph.

\section{Section}

And yet another paragraph after the section!
\end{document}

To render more or less as :

My Title

Author's name

  1. First paragraph.

  2. Another paragraph.

1. Section

  1. And yet another paragraph after the section!

I've seen a solution based on the everyhook package but the problem is that it numbers a bit too much… Like any solution that would redefine the \par internal command, which is used in many places (eg section titles). For instance, it also numbers the title, etc. while i'd like to get only "proper" paragraphs to be numbered (but I don't know how to tell LaTeX what constitutes a proper paragraph without the \paragraph command).

Thanks!

Best Answer

You need to give some indication that the following text is meant to be a numbered paragraph.

% nparas.tex (numbered paragraphs)
\documentclass{article}
\newcounter{np} % numbering your paras
\newcommand*{\np}{\refstepcounter{np}\par\noindent\arabic{np}. }
\begin{document}
\title{A Title}
\author{A N Author}
\maketitle
\np First paragraph.

\np Another paragraph.
\section{Section}

\np A paragraph after the section.
\np More.
\end{document}
Related Question