From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: "G. Branden Robinson" <g.branden.robinson@gmail.com>,
linux-man <linux-man@vger.kernel.org>
Cc: mtk.manpages@gmail.com
Subject: Re: man-pages.7: Simplify indentation of structure definitions, shell session logs, and so on
Date: Tue, 29 Sep 2020 22:15:18 +0200 [thread overview]
Message-ID: <35b5a9ff-4133-8301-bb75-4b13f7861c9a@gmail.com> (raw)
In-Reply-To: <20200921141552.tpuhdxo24lc6e7dh@localhost.localdomain>
Hi Branden,
I want to circle back to a point you raised...
On 9/21/20 4:15 PM, G. Branden Robinson wrote:
> At 2020-09-21T09:49:11+0200, Michael Kerrisk (man-pages) wrote:
>> On Mon, 21 Sep 2020 at 09:32, Alejandro Colomar <colomar.6.4.3@gmail.com> wrote:
>>> Indentation of structure definitions, shell session logs, and so on
>>>
>>> When structure definitions, shell session logs, and so on are included
>>> in running text, indent them by 4 spaces (i.e., a block enclosed by
>>> .in +4n and .in), format them using the .EX and EE macros, and surround
>>> them with suitable paragraph markers (either .PP or .IP). For example:
>>>
>>> .PP
>>> .in +4n
>>> .EX
>>> int
>>> main(int argc, char *argv[])
>>> {
>>> return 0;
>>> }
>>> .EE
>>> .in
>>> .PP
>>>
>>>
>>> That could be simplified to the following, right?:
>>>
>>> .IP
>>> .EX
>>> int
>>> main(int argc, char *argv[])
>>> {
>>> return 0;
>>> }
>>> .EE
>>> .PP
>>>
>>> Or is there any difference?
>>
>> .IP indents by 8 spaces by default, I think.
>
> 7 "ens" on nroff devices (like terminals), 7.2n on troff devices.
>
> An "en" is a traditional typesetting unit of measure, the width of a
> letter "n" in the font being used. For monospaced fonts, including
> those used in character-cell terminals--barring the employment of CJK
> "fullwidth" code points--this is the same width as a space.
>
>> Also, .IP won't indent further, if we are already in an area of
>> indented paragraphs.
>
> This is true. In my maintenance work on groff's man pages I have
> devised an idiom of calling .RS twice, putting in the desired material,
> and then calling .RE twice.
If I understand what you are saying, then iif we are at an indented
level (.TP, .IP), then we can use your idiom:
.RS
.RS n
...
.RE
.RE
But, this idiom won't work if we're not at an indented level (?).
In other words, at .PP level we should not use .RS/.RS n/.RE/.RE,
right?
By contrast, ".in +n/.in" works regardless of whether we
are at an indented level, right? (I'm not saying this recommend
the use of .in; I just want to clarify my understanding.)
Thanks,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
next prev parent reply other threads:[~2020-09-29 20:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 21:40 [PATCH] system_data_types.7: Add note about length modifiers and conversions to [u]intmax_t, and corresponding example Alejandro Colomar
2020-09-21 5:39 ` Michael Kerrisk (man-pages)
2020-09-21 7:32 ` man-pages.7: Simplify indentation of structure definitions, shell session logs, and so on Alejandro Colomar
2020-09-21 7:49 ` Michael Kerrisk (man-pages)
2020-09-21 14:15 ` G. Branden Robinson
2020-09-24 8:15 ` Michael Kerrisk (man-pages)
2020-09-27 6:03 ` G. Branden Robinson
2020-09-29 13:12 ` Michael Kerrisk (man-pages)
2020-09-29 20:15 ` Michael Kerrisk (man-pages) [this message]
2020-09-30 12:02 ` G. Branden Robinson
2020-09-30 12:54 ` G. Branden Robinson
2020-10-01 7:33 ` Michael Kerrisk (man-pages)
2020-10-26 7:00 ` Michael Kerrisk (man-pages)
2020-09-21 8:19 ` [PATCH v2] system_data_types.7: Add note about length modifiers and conversions to [u]intmax_t, and corresponding example Alejandro Colomar
2020-09-21 8:29 ` Alejandro Colomar
2020-09-21 10:38 ` Michael Kerrisk (man-pages)
2020-09-21 13:32 ` [PATCH v3] " Alejandro Colomar
2020-09-21 14:13 ` Michael Kerrisk (man-pages)
2020-09-21 14:39 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=35b5a9ff-4133-8301-bb75-4b13f7861c9a@gmail.com \
--to=mtk.manpages@gmail.com \
--cc=g.branden.robinson@gmail.com \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.