groff
[Top][All Lists]
Advanced

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

Re: .TQ to replace .PD 0


From: Ingo Schwarze
Subject: Re: .TQ to replace .PD 0
Date: Tue, 24 May 2022 04:44:21 +0200

Hi Ralph, Branden, and Alejandro,

G. Branden Robinson wrote on Mon, May 23, 2022 at 08:03:30AM -0500:
> At 2022-05-23T10:34:44+0100, Ralph Corderoy wrote:
>> Ingo wrote:

>>> The typical use case is in a tagged list that uses normal vertical
>>> spacing in general, but contains a few entries that need two or more
>>> tags for a few of the list entries.  For example, in a csh(1)
>>> manual page, you might say something like:
>>>
>>>   .TP
>>>   \fBcd\fP [\fIname\fP]
>>>   .TQ
>>>   \fBchdir\fP [\fIname\fP]
>>>   Change the shell's working directory to ...
>>>   .TP
>>>   .B continue
>>>   Continue execution of the nearest enclosing
>>>   .B while
>>>   or ...

>> Wouldn't one just wrap the .TP paragraph in a pair of .PDs?
>> 
[...]
>>     .TP
>>     \fBcd\fP [\fIname\fP]
>>     .PD 0
>>     .TP
>>     \fBchdir\fP [\fIname\fP]
>>     Change the shell's working directory to...
>>     .PD
>>     .
>>     .TP
>>     .B continue
>>     Continue execution of the nearest enclosing...

Unless i'm missing something, the two code snippets above produce
the same output with both groff and mandoc.

Your version (with .PD) has the clear advantage that it is more
portable: it is likely to work on any man(7) implementation,
whereas .TQ might fail on implementations that are neither
groff nor mandoc.

My version has the (doubious) advantage that it's a bit less
presentation-oriented and a bit more indicative of semantics.
How much that is worth in a language like man(7) that is almost
entirely presentation-oriented and provides very little semantic
markup in the first place is open for debate.  I tend to think
portability is possibly more important than the fact that my
version with .TQ looks minimally nicer.  So if somebody wrote
a new manual page in man(7), i would probably recommend your
version with .PD rather than mine with .TQ.

The reason i presented my version anyway is that Doug indirectly
asked what the point of .TQ is: what i have shown is what i
guess .TQ was likely invented for.  That doesn't imply a
recommendation to use it.

> Yes, that is precisely the form that Alejandro offered when inquiring
> about this subject in the original post to the thread.
> 
> https://lists.gnu.org/archive/html/groff/2022-05/msg00022.html

I'm not convinced this is exactly what Alejandro asked about.
If i read Alejandro's original posting correctly, he wanted to
know whether .TQ is adequate when he wants *two complete*
items (both including a tag and a short body) without intervening
vertical spacing, whereas i talked about *one* item that happens
to have two tags.

I'm not sure whether Alejandro wanted a whole list (with more than
two items) in that way, with no spacing between any of the lines,
which is sometimes useful for lists where all the bodies are
short enough to fit on a single line, or whether he had a completely
normal list with normal vertical spacing in mind and only wanted
no spacing between two particular items.  That sounds strange at
first, but might occasionally make sense when these two items
are significantly more closely related to each other than to the
rest of the list, or when you have a long list with many items,
but all the item bodies are short enough to fit on a single line,
and you want to form groups of items.

In either case, i think the best answer to Alejandro's original
question is: if you value portability, which you probably should,
using .PD is better than using .TQ, the reason being that the
gain in beauty from .TQ is small and the portability risk in
using it is real.

Yours,
  Ingo



reply via email to

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