4

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!

  • 1
    Sounds like you don't want the \paragraph in any case, it is a sectioning command similar to \section and \chapter. It is not meant to be used for the body text in the paragraph. – Torbjørn T. May 15 '16 at 16:37
  • Thank you I have edited my question to reflect that I was talking more generally about having to insert any kind of command at the beginning of every paragraph. – Peutch May 18 '16 at 18:39
  • @Peutch: Do you only have \maketitle and \section as being "non-paragraph" content? – Werner May 18 '16 at 19:06
  • @Werner No unfortunately, I'll be using tables, figures, lists, and probably many other things that I cannot think of right now, that rely on \par. – Peutch May 24 '16 at 15:29
4

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}
  • 1
    Thank you. If I understand, you are suggesting it is not possible to do without inserting a specific command at the beginning of every "true" paragraph? – Peutch May 18 '16 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.