1

I am numbering unindented paragraphs and want the numbers to line up with section headings (that are not numbered) and all paragraph lines including the first line, to justify left like so:

Section Heading
1.  First line of first paragraph...
    second line of first paragraph...
.
.
.

10. First line of tenth paragraph... 
    second line of tenth paragraph...

Another Section Heading
11. First line of 11th paragraph...

I would also like to be able to handle double digit paragraphs.

Here is what I have so far:

\documentclass{article}
\usepackage{parskip}
\usepackage{indentfirst}
\setcounter{secnumdepth}{0}
\renewcommand\thesection{}
\newcounter{np} % numbering your paras
\newcommand*{\np}{\refstepcounter{np}\par\arabic{np}. }
% Outdent first line of paragraph.
\setlength{\leftskip}{1em}
\begin{document}
  \section{Section Heading}
  \np First line of first paragraph...
\end{document}

But the numbers and text align like so, which I don't want:

Section Heading
1. First line of first paragraph...
second line of first paragraph...
1
  • Fixed. Thanks Barbara.
    – pollywog
    May 3, 2020 at 5:47

2 Answers 2

2

Got it working with the help of a couple of other questions:
Balancing out paragraph indentation after one- and two-digit paragraph numbers
LaTeX: indent from second line
For some reason, I could not redefine \para to avoid creating a new command and having to put \np before each paragraph.

\documentclass{article}
\usepackage{fontspec}
\usepackage{parskip}
\usepackage{indentfirst}
% Remove all section numbering
\setcounter{secnumdepth}{0}

\newcounter{paranum}
\newcommand*{\np}{%
  \refstepcounter{paranum}\par\arabic{paranum}%
  \ifnum\value{paranum} < 10%
    \hphantom{0}%
  \else\relax\fi%
  \hskip 1.5em\relax%
  \hangindent=2.5em%
  \hangafter=1%
}
\begin{document}
  \section{First section}
    \np Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  \section{Second section}
    \np Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\end{document}
0

enter image description here

\documentclass{article}
\usepackage{parskip}
%\usepackage{indentfirst}
\usepackage{enumerate}
\usepackage[shortlabels]{enumitem}
\setcounter{secnumdepth}{0}
\renewcommand\thesection{}
%\newcounter{np} % numbering your paras
%\newcommand*{\np}{\refstepcounter{np}\par\arabic{np}. }
% Outdent first line of paragraph.
%\setlength{\leftskip}{1em}
\begin{document}
  \section{Introduction}
  \begin{enumerate}[align=left, leftmargin=1.2cm,  labelwidth=1cm]
    \item First line of first paragraph kjhsdfjs ashdjh jhjehwqjh qwhjwhejwq  ewqhehehewqhjkqw
    \item asllsk aslkeldkewke324 2 l3kl lemr erfejfs ,fm.,dsmf js j  jrsdsrdj sdrjklsj k  kkk
  \end{enumerate}

\end{document}
1
  • Thanks, but this is a long document. I can't put that much scaffolding in to each line! Ideally, I do not even want to specify \para or \np.
    – pollywog
    May 2, 2020 at 10:00

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.