groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hierarchical numbering in mom


From: Peter Schaffter
Subject: Re: Hierarchical numbering in mom
Date: Tue, 9 Feb 2021 16:32:20 -0500
User-agent: Mutt/1.9.4 (2018-02-28)

On Tue, Feb 09, 2021, Dmitriy Kurshakov wrote:
> I am trying to make a document with hierarchical numbering like in
> agreement:
> 1. Heading 1.
> 1.1. Long paragraph 1.1.
> 1.2. Long paragraph 1.2.
> 2. Heading 2.
> 2.1. Long paragraph 2.1.
> ...and so on.
> As far as I understand mom's documentation, the hierarchical numbering is
> available only for headings.

True.

> My attempts to get hierarchical paragraph numbering with nested
> lists has no success.

LIST is not the way to go.  Rather, put this at the top of your
file:

.am HEADING
. nr para 0 1
. nr head +1
..
.am PP
  \\n[head].\\n+[para].\ \"
..

Assuming '.HEADING_STYLE 1 NUMBER', normal usage of

.HEADING 1 <heading>
.PP
<text>
.PP
<text>

will give you paragraphs numbered as per your example.

Note that this is a quick and dirty solution.  It works correctly only for
first-level headings.

-- 
Peter Schaffter
https://www.schaffter.ca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]