From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
linux-man@vger.kernel.org, colomar.6.4.3@gmail.com
Subject: Re: .RS
Date: Thu, 12 Nov 2020 02:09:54 +1100 [thread overview]
Message-ID: <20201111150950.u7lf3xeulydbd2vr@localhost.localdomain> (raw)
In-Reply-To: <ae05d6bd-af93-9b49-25a6-e9c69ae402ec@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5568 bytes --]
Hi Alex!
And hi to Michael, too. I'm sorry I haven't responded to your pings
about a good idiom for inset code examples. The main reason is that I
don't yet have one that satisfies all of your criteria. The other is
that groff is heaving its vast bulk toward a release, and I've been in a
perfectionist frenzy trying to clear my plate of my personal release
goals for it. This includes man pages totalling 323 pages (not counting
groff_mdoc(7)[1]), which might not sound all that daunting to the author
of the scale-tipping _LPMI_ codex. :D
At 2020-11-11T15:22:27+0100, Alejandro Colomar (man-pages) wrote:
> Hi,
>
> We already talked about something similar some time ago.
>
> I see [.RS 4] and [.RS +4n] used in the man pages.
> And there are also [.in +4n] and I think I've also seen [.in 4].
> Is there any difference between [+4n] and a simple [4]?
Not usually. *roff parameters can be dimensionless (like hyphenation
modes), but many of them, like page length, line length, page offset,
indent(ation), and many others, have dimensions. groff, like AT&T troff
before it, supports the expression of dimensions in a variety of units,
including U.S. traditional, metric, and printer's units (points, picas).
Ultimately, internally, all these different units are converted to
"basic units" which are meaningless outside of the formatter (but you
sometimes see them in diagnostic messages).
So when you use a request or a built-in register that has a dimension
associated with it, you need to either know what units are required to
get predictable output, or _tell_ *roff what units you want to use.
The way you do that is with a letter called a "scaling indicator".
These are documented. See the section "NUMERICAL EXPRESSIONS"[2] in
groff(7) for a complete list.
Requests and (some) registers have a "default scaling indicator". These
are document with the corresponding item.
"n" refers to "ens", a typographer's unit that is, roughly half an "em",
and an "em" is the width of a lowercase "m" in the current font. For
character-cell terminals, 1m equals 1n equals 1 character cell, so it's
pretty easy to get a handle on.
> Which is the preferred one?
That's a terrific question. I've wavered on this issue myself.
Semantically, there is no difference between ".RS" (or ".in") "4" and
"4n"--because the default scaling indicator for this macro (or request)
is "n".
At present I kind of lean toward "4n" because I think it disserves man
page authors to get too far away from the knowledge that groff is a
_typesetting_ system as troff and nroff (and roff, and Saltzer's RUNOFF)
were before it.
If man pages were only ever rendered to character-cell terminals[3], I'd
probably just settle on ignoring scaling indicators. In fact, I'm not
sure they existed in *roff languages before Ossanna wrote troff. As I
understand it, on Teletypes and line printers, your horizontal dimension
was character cells, your vertical dimension was lines, and you had
special logic for reverse line feeds and half line feeds in either
direction, and that was as granular as things got.
> And BTW, does [.RS] do anything different than [.in]?
At its core, no--but it saves a lot of state so that you can nest
further .RS calls, and use .RE, and so that the sectioning macros (.SH
and .SS) can undo their effect without causing havoc.
> I guess the code implementing those macros is written somewhere.
> Where can I have a look at that code to see it myself?
Here's the bleeding edge version:
https://git.savannah.gnu.org/cgit/groff.git/tree/tmac/an-old.tmac
There is almost certainly a copy of this file, probably from groff
1.22.4 on your system. On my Debian box, it's at
/usr/share/groff/1.22.4/tmac/an-old.tmac.
Thomas Dickey once complained about the lack of comments in this
file--he's right, the things that a casual user most needs commented,
are not. I've tried to remedy that defect in groff_man(7), but a more
Doxygenish approach to the package source itself would also be a good
idea.
Regards,
Branden
[1] groff_mdoc(7) will _ship_, but a person _really_ doesn't want to
know why it's not in my page count. Ask me if you want a challenge
involving possibly diversions and traps.
[2] In groff 1.23.0, to no longer be in shouty capitals. :D
[3] I sometimes get into a bit of conflict with some man page writers
who care less than nothing for any output device that isn't a terminal.
I want to accommodate such people as much as I can without compromising
quality for those who want to want to see man pages properly typeset.
The most recent episode of contretemps involves the sad history of
ASCII, ISO 8859, Unicode, and how exactly ' and ` (and to a lesser
extent, ^ and ~) should be rendered. Some painful choices were made in
the 1970s, and some procrastination was coddled in the 2000s, that have
people grumbling today. People threaten that the masses will just "go
to Markdown" if ignorance is not coddled. For people who really care
_only_ about terminal input, I'm not sure such an out-migration can be
stopped, or should be. Proper typesetting carries a lot of complexity
and it's hard to justify that complexity to people who don't want what
it can accomplish.
About the only challenge Markdown faces is filling, and I'm sure there
are tools to handle that it in its much simpler problem domain. That,
or people just resize or horizontally scroll their terminals. The
mindset is a bit foreign to me.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-11-11 15:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-11 14:22 .RS Alejandro Colomar (man-pages)
2020-11-11 15:09 ` G. Branden Robinson [this message]
2020-11-11 15:34 ` .RS Alejandro Colomar (man-pages)
2020-11-12 7:09 ` .RS G. Branden Robinson
2020-11-12 9:49 ` .RS Alejandro Colomar (man-pages)
2020-11-12 19:57 ` .RS Alejandro Colomar (man-pages)
2020-11-12 20:57 ` .RS Alejandro Colomar (man-pages)
2020-11-13 8:03 ` .RS G. Branden Robinson
2020-11-13 8:52 ` .RS Michael Kerrisk (man-pages)
[not found] ` <20201113093846.jzxlkw3o3pqkkr47@localhost.localdomain>
2020-11-13 10:02 ` .RS Michael Kerrisk (man-pages)
2020-11-13 10:15 ` .RS Alejandro Colomar
2020-11-13 10:27 ` .RS Michael Kerrisk (man-pages)
2020-11-13 10:34 ` .RS G. Branden Robinson
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=20201111150950.u7lf3xeulydbd2vr@localhost.localdomain \
--to=g.branden.robinson@gmail.com \
--cc=alx.manpages@gmail.com \
--cc=colomar.6.4.3@gmail.com \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox