[Tex/LaTex] How to make a hanging indent for numbered paragraphs

indentationparagraphs

The code I have is:

    1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat \

But as you can see in this output:

ss](http://i.imgur.com/g3p62o2.png)![ss
The part that says "mod" is not aligned with the first word, "Lorem." I would like all subsequent parts of the paragraph like the letter 'm' in "mod" to be directly under the letter 'L' in "Lorem" including any future numbered paragraphs (there will be some other stuff in between the paragraphs). How can I achieve this?

Best Answer

Others have mentioned enumerations, but perhaps have overlooked the request for material between items. An out-of-the-box solution for this is provided by the enumitem package, where there is the possibility of labelling an enumerate with a series name. Following instances can then use enumerate together with resume

 \begin{enumerate}[series=numpars]
 \item ...
 \end{enumerate}

 ....

 \begin{enumerate][resume=numpars]
 \item ...
 \end{enumerate}

Sample output

\documentclass{article}

\usepackage{enumitem}

\usepackage{lipsum} %For dummy text

\begin{document}

\lipsum[1]

\begin{enumerate}[series=numpars]
\item \lipsum[2]
\end{enumerate}

\lipsum[3]

\begin{enumerate}[resume=numpars]
\item \lipsum[4]
\end{enumerate}

\end{document}

If you would like a dedicated environment numpar for this without the need for resume or item then you can use the following code, which produces the same output as above. The idea is to add a toggle to keep track of whether this is the first instance or not and pass either series or resume to the list constructor. Additionally, it has been set-up with a dedicated list type numparmain, that could be customised further (via standard options in enumitem) to adjust indentation or label style.

\documentclass{article}

\usepackage{enumitem,etoolbox}
\newlist{numparmain}{enumerate}{1}
\setlist[numparmain]{label=\arabic*.}

\newtoggle{firstnumpar}
\toggletrue{firstnumpar}
\newenvironment{numpar}{\iftoggle{firstnumpar}%
      {\begin{numparmain}[series=numpars]}%
      {\begin{numparmain}[resume=numpars]}%
    \global\togglefalse{firstnumpar}%
    \item\ignorespaces}%
  {\end{numparmain}}


\usepackage{lipsum} %For dummy text

\begin{document}

\lipsum[1]

\begin{numpar}
 \lipsum[2]
\end{numpar}

\lipsum[3]

\begin{numpar}
  \lipsum[4]
\end{numpar}

\end{document}
Related Question