I'm trying to format my text according to the following rules:
- From the second paragraph on, paragraphs should be numbered.
- Paragraph numbers should be inside text area, aligned to left margin.
- First line of paragraph text should be indented by 2.5cm (starting from margin, not from number)
So far I have achieved the following.
\documentclass[12pt,a4paper]{article}
\usepackage{indentfirst} %indent first paragraph
\usepackage{lipsum}
\setlength{\parindent}{2.5cm} %paragraphs should be indented by 2.5 cm from margin
\newcommand{\parnum}{\arabic{parcount}.}
\newcounter{parcount}
\newcommand\p{%
\stepcounter{parcount}%
\parnum \hspace{1em}%
}
\stepcounter{parcount} % start at number 2
\newenvironment{parnumbers}{%
\setlength{\parindent}{0cm}
\par%
\everypar{\noindent \stepcounter{parcount}\parnum \hspace{2.3cm}}% NEED TO ADJUST. Paragraph text (not numbers) should be indented by 2.5cm from margin.
}{}
\begin{document}
\lipsum[1]
\begin{parnumbers}
\lipsum[2-15]
\end{parnumbers}
\end{document}
Instead of having a fixed \hspace
after the paragraph counter, how do I insert 2.5cm
minus the length of the paragraph number and the dot? For example, when I have double digits paragraph numbers, the fixed \hspace
makes the text slightly more indented then it should be.
Any thoughts?
Thank you in advance.
Rossi