Thread (20 messages) 20 messages, 3 authors, 2021-09-12

Re: [PATCH] filename.7: new manual page

From: Thaddeus H. Black <hidden>
Date: 2021-09-09 02:37:43

On Wed, Sep 08, 2021 at 05:45:43PM +0200, Alejandro Colomar (man-pages) wrote:
quoted
Question 1:  do you happen to know of a good example of an existing
manual page that already does this?  If you did, then I could follow the
example.  Otherwise, it might be tricky, for the existing subsections
already have tagged paragraphs and other structure within them.
Perhaps .RS/.RE could be used.  I am not sure.
I don't know of a page that does this, and some of them are a bit
inconsistent, so I'd have to search through the source code of the pages to
find one that is a perfect example.  So I'll write/draw a schema here:

You could do it like this:

.TP
	tag 1
.PP
		paragraph 1.1
.IP
		paragraph 1.2
.IP
		paragraph 1.3
.RS
.TP
		tag 1.4
.PP
			paragraph 1.4.1
.IP
			paragraph 1.4.2
.RS
.TP
			tag 1.4.3
.PP
				paragraph 1.4.3.1
.IP
				paragraph 1.4.3.2
.IP
				paragraph 1.4.3.3
.RE
.IP
			paragraph 1.4.4
.RE
.IP
		paragraph 1.5


Was it helpful?
Yes but it does not do exactly what you want.  However, after some
reading and experimentation, I find that the following does exactly what
you want (if I correctly understand what you want).

    .\" The .SSS macro introduces a subsubsection
    .\" as the .SS macro introduces a subsection.
    .de1 SSS
    .  if !r SSS_SN_ORIG .nr SSS_SN_ORIG \\n[SN]
    .  nr SN (2 * \\n[SSS_SN_ORIG])
    .  SS \&\\$*
    .  nr SN (\\n[SSS_SN_ORIG])
    ..
    .TH ABC 7 1970-01-01 "Linux" "Linux Programmer's Manual"
    .SH SECTION FOO
    .PP
    Foo flargh.
    .SS Subsection bar
    .PP
    Bar blargh.
    .SSS Subsubsection baz
    .PP
    Baz mnargh.

Result:

    ABC(7)                 Linux Programmer's Manual                 ABC(7)

    SECTION FOO
           Foo flargh.

       Subsection bar
           Bar blargh.

          Subsubsection baz
           Baz mnargh.

    Linux                          1970-01-01                        ABC(7)

On the PDF output device, the result is similar, though the narrow
offset (only 1.2en) between "Subsubsection baz" and "Baz mnargh" is
slightly unappealing in the PDF.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help