bugGNU roff - Bugs: bug #59798, an-old.tmac: Add '.na' to macro...

 
 

bug #59798: an-old.tmac: Add '.na' to macro '.TS' and '.ad' to macro '.TE'

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Fri 01 Jan 2021 09:30:57 PM UTC
   
 
Category:  Macro man Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Invalid
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 18 Jan 2021 08:21:49 AM UTC, comment #1: 

After some experimentation, I have determined that the suggested patch is incorrect.

.TS and .TE should not alter the adjustment mode of the text.

The tbl(1) man page is not clear enough about how adjustment in text blocks is handled, and neither is Lesk's tbl paper from Volume 2 of the V7 Unix manual.

If I apply the patch, then after the first table in every man page in the groff distribution that uses tbl, the adjustment on the non-table text afterwards is incorrectly set to both margins even if the new AD string feature had been used to set it to 'l'.

One could attempt to lay this at the doorstep of the new AD string feature, or argue for saving and restoring the string as part of the .TS and .TE macros, but I think such claims would needless make complex a simple fact that is the status quo.

Text blocks in tables are adjusted as was the text immediately prior to the table, unless the table author uses requests to change it.

This is a simple rule to remember, and I plan to add documentation of it to tbl(1) shortly.

I did try comparing groff's behavior with Heirloom Doctools tbl+nroff+man, but unfortunately my version of Heirloom (191015) introduces a line break prior to tbl text blocks, which is pretty dubious.  Nonetheless it appears to be consistent with the groff status quo as regards adjustment of text blocks.  (Heirloom forces left adjustment for all man pages rendered by nroff.)

I'm attaching my experimental file, and the patch I ended up rejecting.

(file #50737, file #50738)

G. Branden Robinson <gbranden>
Group administrator
Fri 01 Jan 2021 09:30:57 PM UTC, original submission:  

tmac/an-old.tmac: Add '.na' to macro '.TS' and '.ad' to macro '.TE'

  "tbl" manages the adjustment of margins on its own.

  An external or default adjustment setting can cause a warning, like

"cannot adjust line at both margins"

  for example in

  test-nroff -man -z man/groff_char.7.man

troff: backtrace: file 'groff_char.7.man':1545
troff: groff_char.7.man:1545: warning [p 10, 9.8i]: cannot adjust line at both margins
troff: backtrace: file 'groff_char.7.man':1546
troff: groff_char.7.man:1546: warning [p 10, 10.0i]: cannot adjust line at both margins
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 tmac/an-old.tmac | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index b7781eca..de27558f 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -590,6 +590,7 @@
 .\" table support
 .
 .de1 TS
+.  na \" "tbl" adjusts margins on its own, it is restored in .TE.
 .  \" If continuous rendering, tell tbl not to use keeps.
 .  ie \\n[cR] \
 .    nr 3usekeeps 0
@@ -607,6 +608,7 @@
 ..
 .
 .de1 TE
+.  ad \" Restore adjustment, as it was removed in .TS.
 .  HTML-IMAGE-END
 .  if \\n[an-html] \
 .    ll \\n[an-TS-ll]u
--
2.29.2


Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #50737:  59798.man added by gbranden (557B - application/x-troff-man)
file #50738:  59798.diff added by gbranden (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Updated the item)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-10 gbranden Summary[PATCH] an-old.tmac: Add '.na' to macro '.TS' and '.ad' to macro '.TE' an-old.tmac: Add '.na' to macro '.TS' and '.ad' to macro '.TE'
    2021-01-18 gbranden Attached File- Added 59798.man, #50737
        Attached File- Added 59798.diff, #50738
        Item GroupFeature change Incorrect behaviour
        StatusNone Invalid
        Assigned toNone gbranden
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code