groff
[Top][All Lists]
Advanced

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

Re: RS/RE and paragraphing macros


From: Alex Colomar
Subject: Re: RS/RE and paragraphing macros
Date: Tue, 21 Feb 2023 00:30:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

Hi Branden,

On 2/20/23 07:10, G. Branden Robinson wrote:
[...]

Okay, so now it makes sense.  There's indentation and left margin, and
they're different things (still weird that the amount of movement(?)
of the left margin is also called indentation (.RS [indentation])).

That's such a good point that I pushed a fix for it.

https://git.savannah.gnu.org/cgit/groff.git/commit/?id=b14a7dda59bf0fcf10667a40a31fabe78e479ebd

:)


But I still have some doubts:

Is RS a paragraphing macro?

No.  It breaks the line and moves the margin.

Ahh, okay, so it breaks the line but it doesn't separate paragraphs.


Does it start a new "normal" paragraph?

Yes and no?  I suspect you are thinking of paragraph macros as things
that have scope.  Or of things like HTML elements that open <tag> and
close </tag>.

Not really.  I don't know much HTML

[...]
Or does it continue in the same paragraph?  Empirically, I'd say it
starts a new paragraph, but that seems undocumented.

Paragraphing macros in *roff packages _separate_ paragraphs; they do not
_enclose_ paragraphs.

Okay, so RS doesn't separate paragraphs. It does only break a line and move the left margin. Where do you end up after breaking a line? Since you didn't start a new paragraph, I'd guess that it would be reasonable to end up at the same indentation as the previous paragraph, no? Let's see with an example what we get:


$ cat br.man
.TH a s d f
.SH br
foo bar baz
.IP
qwe rty uio
.br
zxc vbn xcv
.PP
lkjhjhjg hgfgfd
$ man ./br.man | cat
a(s)                                                              a(s)

br
       foo bar baz

              qwe rty uio
              zxc vbn xcv

       lkjhjhjg hgfgfd

f                                  d                              a(s)



Okay, this is what I expected. .br continues at the same indentation of the IP, just at the next line. Let's try the same with RS/RE; I'll use an inset of 0, to don't move the margin, so we only break the line.


$ cat RS.man
.TH a s d f
.SH br
foo bar baz
.IP
qwe rty uio
.RS 0
zxc vbn xcv
.RE
.PP
lkjhjhjg hgfgfd
alx@dell7760:~/tmp$ man ./RS.man | cat
a(s)                                                              a(s)

br
       foo bar baz

              qwe rty uio
       zxc vbn xcv

       lkjhjhjg hgfgfd

f                                  d                              a(s)



Hummm, this is definitely not as simple as "breaks the line and moves the margin". The margin is not moved because of 0, so this should be just equivalent to .br from your own definition. However, it's not. It does some extra magic, which I'd call "RS sets the indentation of the scoped block to 0; RE resets to the previous indentation".

I'm not saying that is necessarily bad, but we need to document it. In fact, after thinking about it, it can help to start a new block of indentation: that way, when you close with RE, you'll be able to continue bullet lists without specifying the indentation, even if some bullet within the list was rather long and had nested stuff.

So, I think RS/RE has the right choice; but it needs some more documentation.

Did that make sense to you?

Cheers,

Alex

--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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