Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Paragraph numbering?

163 views
Skip to first unread message

Rui

unread,
Feb 24, 2014, 6:55:43 AM2/24/14
to
Is there a way to add paragraph numbers to a LaTeX document?


Thanks in advance,
Rui Maciel

jospic

unread,
Feb 24, 2014, 7:07:49 AM2/24/14
to
\setcounter{secnumdepth}{4}


Regards.
-jospic

Rui

unread,
Feb 24, 2014, 9:44:48 AM2/24/14
to
Does that command only affects the contents of \paragraph{}? I've tested it and it doesn't seem usable, as it outputs text in bold and the counter, in the very least, needs a lot of work.

What I was looking for was something which might turn this content:

<blockquote>

\chapter{Foo}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

Etiam eget ligula eu lectus lobortis condimentum. Aliquam nonummy auctor massa.

\section{Foo 2}

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla at risus.

\chapter{Bar}

Quisque purus magna, auctor et, sagittis ac, posuere eu, lectus. Nam mattis, felis ut adipiscing.

</blockquote>


Into something like this:

<blockquote>

1. Foo

§ 1 (1) Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

§ 1 (2) Etiam eget ligula eu lectus lobortis condimentum. Aliquam nonummy auctor massa.


1.1 Foo 2

§ 1.1 (1) Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla at risus.



2. Bar

§ 2 (1) Quisque purus magna, auctor et, sagittis ac, posuere eu, lectus. Nam mattis, felis ut adipiscing.

</blockquote>


Preferably, the paragraph counter (the §\d bit) would be placed outside the text body.


Does LaTeX provide any package or hack that pulls this off?

Bob Tennent

unread,
Feb 24, 2014, 10:42:02 AM2/24/14
to
On Mon, 24 Feb 2014 06:44:48 -0800 (PST), Rui wrote:

> 1. Foo
>
> ง 1 (1) Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
>
> ง 1 (2) Etiam eget ligula eu lectus lobortis condimentum. Aliquam nonummy auctor massa.
>
>
> 1.1 Foo 2
>
> ง 1.1 (1) Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla at risus.
>
>
>
> 2. Bar
>
> ง 2 (1) Quisque purus magna, auctor et, sagittis ac, posuere eu, lectus. Nam mattis, felis ut adipiscing.
>
></blockquote>
>
>
> Preferably, the paragraph counter (the ง\d bit) would be placed outside the text body.
>
>
> Does LaTeX provide any package or hack that pulls this off?

I'm guessing that what you need is a style for legal documents.

Check out

http://www.ctan.org/topic/legal
http://latexforlawyers.org/
https://github.com/rschulman/latex4lawyers
https://github.com/mjreed/latex-skeleton
http://willhardy.com.au/aglc-and-latex/

Otherwise, learn to use the standard LaTeX styles. For example, use
\item instead of expecting every new paragraph to be automatically
numbered. And don't use \chapter unless you're writing a book.

Bob T.

Rui

unread,
Feb 24, 2014, 5:22:34 PM2/24/14
to
On Monday, February 24, 2014 3:42:02 PM UTC, Bob Tennent wrote:
> On Mon, 24 Feb 2014 06:44:48 -0800 (PST), Rui wrote:
>
> I'm guessing that what you need is a style for legal documents.

I don't believe I do. I'm only looking for a way to enumerate paragraphs in a plain book or report class. The documents are already avaliable.


> Otherwise, learn to use the standard LaTeX styles. For example, use
>
> \item

Surely there must be an acceptable way to handle this. Even the quick and dirty counter macros that pop up in any google search on this issue don't mess the documentation like a list environment does.


Rui Maciel

Bob Tennent

unread,
Feb 24, 2014, 8:35:24 PM2/24/14
to
The \paragraph sectioning command has nothing to do with the
ordinary paragraphing mechanism (blank line) which doesn't have a
counter associated with it.

If by "the documents are already available" you mean that you have
documents with blank lines that you want to be turned into numbered
"paragraphs", then I suggest you pre-process them.

Bob T.

corporal

unread,
Feb 24, 2014, 11:29:17 PM2/24/14
to
On Monday, February 24, 2014 10:55:43 PM UTC+11, Rui wrote:
> Is there a way to add paragraph numbers to a LaTeX document? Thanks in advance, Rui Maciel

There is an answer provided by Ulrike Fischer (2003) in an old thread:

https://groups.google.com/forum/#!topic/comp.text.tex/a-b3sj66yk0

You should be able to customize this using \S and \thesection to do what you want.
regards from corporal

Markus Kohm

unread,
Feb 25, 2014, 2:25:06 AM2/25/14
to
Rui (Montag, 24. Februar 2014 15:44):

> <blockquote>
>
> 1. Foo
>
> § 1 (1) Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
>
> § 1 (2) Etiam eget ligula eu lectus lobortis condimentum. Aliquam nonummy
> auctor massa.
>
>
> 1.1 Foo 2
>
> § 1.1 (1) Pellentesque habitant morbi tristique senectus et netus et
> malesuada fames ac turpis egestas. Nulla at risus.
>
>
>
> 2. Bar
>
> § 2 (1) Quisque purus magna, auctor et, sagittis ac, posuere eu, lectus.
> Nam mattis, felis ut adipiscing.
>
> </blockquote>
>
>
> Preferably, the paragraph counter (the §\d bit) would be placed outside
> the text body.
>
>
> Does LaTeX provide any package or hack that pulls this off?

Maybe:

\documentclass[parskip=half]{scrartcl}
\usepackage{scrjura}
\renewcommand*{\thecontractSubParagraph}{% To use arabic Subparagraphs
{\theParagraph.\arabic{contractSubParagraph}}%
}

\renewcommand*{\parformat}{% To have the Paragraph number in front of the
par
% number moved outside the text body
\makebox[0pt][r]{% left from the text body
\theSubParagraph\enskip(\thepar)\nobreakspace
}%
\let\nobreakspace\relax% deactivate the following \nobreakspace
}

% Or with numbers inside the text body:
%\renewcommand*{\parformat}{\theSubParagraph\enskip(\thepar)}

\renewcommand*{\getmaxpar}[3]{\def#1{2}}% To have numbers in front of single
% pars of Paragraphs
\usepackage{lipsum}
\begin{document}
\begin{contract}
\Paragraph{title=Foo}
\lipsum[1-2]

\SubParagraph{title=Foo 2}
\lipsum[4]

\Paragraph{title=Bar}
\lipsum[5-6]
\end{contract}
\end{document}

Markus Kohm
--
KOMA-Script, a versatile bundle of classes and packages for LaTeX2e
Current: KOMA-Script 3.12.1697 (see <http://www.komascript.de/current> in
German)

Markus Kohm

unread,
Feb 25, 2014, 2:26:39 AM2/25/14
to
Markus Kohm (Dienstag, 25. Februar 2014 08:25):

> \renewcommand*{\parformat}{% To have the Paragraph number in front of the
> par
> % number moved outside the text body
> \makebox[0pt][r]{% left from the text body
> \theSubParagraph\enskip(\thepar)\nobreakspace
> }%
> \let\nobreakspace\relax% deactivate the following \nobreakspace
> }

The line break broke the code. This must be:

\renewcommand*{\parformat}{% To have the Paragraph number in front of the
% par number moved outside the text body
\makebox[0pt][r]{% left from the text body
\theSubParagraph\enskip(\thepar)\nobreakspace
}%
\let\nobreakspace\relax% deactivate the following \nobreakspace
}

Peter Flynn

unread,
Feb 26, 2014, 3:43:47 PM2/26/14
to
On 02/24/2014 10:22 PM, Rui wrote:
> On Monday, February 24, 2014 3:42:02 PM UTC, Bob Tennent wrote:
>> On Mon, 24 Feb 2014 06:44:48 -0800 (PST), Rui wrote:
>>
>> I'm guessing that what you need is a style for legal documents.
>
> I don't believe I do. I'm only looking for a way to enumerate
> paragraphs in a plain book or report class. The documents are
> already avaliable.

Legal documents often use this style, so it was a good suggestion.

>> Otherwise, learn to use the standard LaTeX styles. For example,
>> use
>>
>> \item

No, this is not a good idea. Messing with the indentation to make items
look like paragraphs is not easy.

> Surely there must be an acceptable way to handle this.

There is, but you must understand that it is a very unusual request.

> Even the quick and dirty counter macros that pop up in any google
> search on this issue don't mess the documentation like a list
> environment does.

I think the answer is the eledmac package, which is used to typeset
scholarly editions. That has facilities for line-numbering and
paragraph-numbering, as far as I know.

///Peter
0 new messages