bugGNU roff - Bugs: bug #60616, [mdoc] groff_mdoc(7) shows section...

 
 

bug #60616: [mdoc] groff_mdoc(7) shows section headings in internal TOC in small font

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Sun 16 May 2021 09:53:46 AM UTC
   
 
Category:  Macro mdoc Severity:  2 - Minor
Item Group:  Rendering/Cosmetics Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 02 Mar 2022 10:18:39 AM UTC, comment #6: 


commit 5125754cdfaa7008f65d9c3f2936626b7bcf0498
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Feb 23 22:08:01 2022 +1100

    [mdoc]: Stop setting `Tn` arguments smaller.

    * tmac/doc.tmac (Tn):
    * tmac/mdoc/doc-syms (Ux, Bx): Stop interpolating string
      `doc-Tn-font-size` to set macro arguments at a smaller type size.
      This leaves the string without a purpose, so...

    * tmac/mdoc/doc-ditroff:
    * tmac/mdoc/doc-nroff: Drop definitions of `doc-Tn-font-size`.

    * tmac/mdoc/doc-syms: Drop interpolations of that string from numerous
      other string definitions.

    Fixes <https://savannah.gnu.org/bugs/?60616>.


G. Branden Robinson <gbranden>
Group administrator
Fri 25 Feb 2022 01:42:38 PM UTC, comment #5: 


comment #4:

>   The "Tn" macro in mandoc is deprecated, see bug #59415 (closed as invalid).


Thanks, Bjarni.  That should make my change to the rendering of its arguments less contentious.


commit 5125754cdfaa7008f65d9c3f2936626b7bcf0498
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Feb 23 22:08:01 2022 +1100

    [mdoc]: Stop setting `Tn` arguments smaller.

    * tmac/doc.tmac (Tn):
    * tmac/mdoc/doc-syms (Ux, Bx): Stop interpolating string
      `doc-Tn-font-size` to set macro arguments at a smaller type size.
      This leaves the string without a purpose, so...

    * tmac/mdoc/doc-ditroff:
    * tmac/mdoc/doc-nroff: Drop definitions of `doc-Tn-font-size`.

    * tmac/mdoc/doc-syms: Drop interpolations of that string from numerous
      other string definitions.

    Fixes <https://savannah.gnu.org/bugs/?60616>.

commit 49d1b3401ff09fd6442df207abae7ba05c252d6c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Feb 23 22:44:53 2022 +1100

    [mdoc]: Drop `doc-curr-size` register.

    * tmac/doc.tmac (initialization): Drop definition of `doc-curr-size`
      register.  It is no longer needed since nothing internal to the
      package now changes the type size.

    * tmac/doc.tmac (Fl, doc-print-recursive, doc-print-prefixes,
      doc-generic-macro, Ar, Cd, doc-do-func-decl, Fd, In, Nm, Pa, Tn,
      doc-enclose-string, Ef, Bd, doc-save-global-vars,
      doc-restore-global-vars, doc-diag-list, Xr, Dl, Vt, Ft, Fa,
      doc-do-func, Fn, doc-do-func-args, Fo, Fc, %A, %B, %C, %D, %I, %J, %N,
      %O, %P, %Q, %R, %T, %U, %V, doc-do-reference, Hf, An, Lk):
    * tmac/mdoc/doc-common (Sh, Ss, Rd):
    * tmac/mdoc/doc-syms (Ux, Bx, At, Dx, Fx, Nx, Ox, Bsx, St, Lb): Drop
      interpolations of the string and comments documenting that each macro
      has a side effect on the type size.


The commits above are pending, not yet pushed.

G. Branden Robinson <gbranden>
Group administrator
Wed 23 Feb 2022 08:37:55 PM UTC, comment #4: 

  The "Tn" macro in mandoc is deprecated, see bug #59415 (closed as invalid).

Bjarni Ingi Gislason <bjarniig>
Wed 23 Feb 2022 10:54:22 AM UTC, comment #3: 

Actually I'll rescope this back to my original complaint because the problem is obvious and I don't think anyone would defend it.

groff_mdoc(7) has an internal table of contents where it uses the `Tn` ("trade name/type name/acronym") macro to set the names of subsequent section headings.

Because `Tn` drops the size of its arguments by a point, to cater to the 1960's U.S. defense industry fetish of setting of acryonyms in small capitals (and which early Unix manuals slavishly imitated after troff was written, because they *could*), the result looks bad.

Arguably this is an abuse of the `Tn` macro's purpose, but it's already pretty murky and I don't want to get involved in litigating its "true" meaning when the simpler solution of having `Tn` just not mess with the type size is readily at hand.

Anyway, I'm again attempting to attach an illustration of the problem.

To reproduce, obtain any recent checkout of groff Git.


$ ./build/test-groff -t -mdoc ./build/tmac/groff_mdoc.7 > foo.ps
$ evince foo.ps



G. Branden Robinson <gbranden>
Group administrator
Wed 23 Feb 2022 05:35:45 AM UTC, comment #2: 


comment #1:

>   How is this supposed to be reproduced?
>
>   How is the file supposed to be displayed?


Hmm, the attachment appears to be corrupt.  Also, I appear to have been confused; the problem is not extant in groff 1.22.4.

I think what probably happened is that I missed a spot where mdoc was using type size changes to get the "small caps" effect for arguments to `Sh` and `Tn` macros.

I see where to fix this.  I've been meaning to align groff mdoc(7)'s styling of semantic content with groff man(7)'s, so now's the time to do that I guess--bracing myself for arguments while noting that mdoc.local remains available.

G. Branden Robinson <gbranden>
Group administrator
Wed 23 Feb 2022 12:37:56 AM UTC, comment #1: 

  How is this supposed to be reproduced?

  How is the file supposed to be displayed?

Bjarni Ingi Gislason <bjarniig>
Sun 16 May 2021 09:53:46 AM UTC, original submission:  

Seen in groff 1.22.4.

See attachment for incongruous appearance.

G. Branden Robinson <gbranden>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bjarniig (Posted a comment)
  • -email is unavailable- added by gbranden (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-02 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2022-02-23 gbranden Attached File- Added groff_mdoc_bad_type_size.png, #52909
        Summary[mdoc] doesn't format some things as man(7) does [mdoc] groff_mdoc(7) shows section headings in internal TOC in small font
    2022-02-23 gbranden Summary[mdoc] writes headings at dubious size [mdoc] doesn't format some things as man(7) does
    2022-02-23 gbranden Item GroupIncorrect behaviour Rendering/Cosmetics
        StatusNone In Progress
        Assigned toNone gbranden
    2021-05-16 gbranden Attached File- Added groff_mdoc_incongruous.png, #51443

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code