URL:
  <https://savannah.gnu.org/bugs/?67355>

                 Summary: [man] `S` register doesn't work as documented or the
code intends
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Fri 25 Jul 2025 09:51:19 PM GMT
                Category: Macro package man
                Severity: 3 - Normal
              Item Group: Rendering/Cosmetics
                  Status: Confirmed
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 25 Jul 2025 09:51:19 PM GMT By: G. Branden Robinson <gbranden>
Two problems that I think are related.

_groff_man_(7) says:

     .SH [heading‐text]
            Set heading‐text as a section heading.  Given no argument,
            SH plants a one‐line input trap; text on the next line
            becomes heading‐text.  The heading text is set in bold (or
            the font specified by the string HF), and, on typesetters,
            slightly larger than the base type size.  If the heading
            font \*[HF] is bold, use of an italic style in heading‐text
            is mapped to the bold‐italic style if available in the font
            family.  The inset level is reset to 1; see subsection
            “Horizontal and vertical spacing” below.  Text lines after
            the call are set as an ordinary paragraph (P).
...
     -rStype‐size
              Use type‐size for the document’s body text; acceptable
              values are 10, 11, or 12 points.  See subsection “Font
              style macros” above for the default.


That refers only to body text, which I think is one of my textual revisions.

Back in _groff_ 1.22.3 days, the page said this:


     .SH [text for a heading]
            Set up an unnumbered section heading sticking out to the
            left.  Prints out all the text following .SH up to the end
            of the line (or the text in the next input line if there is
            no argument to .SH) in bold face (or the font specified by
            the string HF), one size larger than the base document size.
            Additionally, the left margin and the indentation for the
            following text is reset to the default values.
...
     -rSxx  Base document font size is xx points (xx can be 10, 11,
            or 12) rather than 10 points.


...whatever "base document font size" means.  The size of the body text would
be a reasonable assumption, but it implies more strongly that other sizes will
be computed relative to that size.  And that is what "tmac/an.tmac"'s `TH`
macro definition attempts to do.

(I also have a grievance with the circularity of the locution "one size
larger", but I addressed that long ago.)


.  nr PS    10z \" default type size
.  nr VS    12p \" default vertical spacing
.  nr PS-SS 10z
.  nr PS-SH 10.95z
.
.  \" use sizes similar to LaTeX
.  if t \{\
.    ie (\\n[S] == 11) \{\
.      nr PS    10.95z
.      nr PS-SS 10.95z
.      nr PS-SH 12z
.      nr VS    13.6p
.    \}
.    el \{\
.      if (\\n[S] == 12) \{\
.        nr PS    12z
.        nr PS-SS 12z
.        nr PS-SH 14.4z
.        nr VS    14.5p
.      \}
.    \}
.  \}


The problems, which a test script I have in preparation illustrates, are
these.

1.  The page "titles" (headers and footers) render at the package default of
10 points on 12 points spacing no matter what.

2.  The attempt to enlarge the type size for section headings never actually
takes.

Observe.

Here's the input document, which I don't expect to further fiddle.


input='.
.TH foo 1 2025-07-25 "groff test suite ps=\n[.s]z, vs=\n[.v]u"
.SH Section ps=\n[.s]z, vs=\n[.v]u
.SS Subsection ps=\n[.s]z, vs=\n[.v]u
.P
Paragraph ps=\n[.s]z, vs=\n[.v]u.
.'


And the test output, which uses "groff -a".


$ ../tmac/tests/an_S-register-works.sh
<beginning of page>
foo(1) General Commands Manual foo(1)
Section ps=10z, vs=12000u 
 Subsection ps=10z, vs=12000u 
 Paragraph ps=10z, vs=12000u.
groff test suite ps=10z, vs=12000u 2025-07-25 1
checking header and footer parameters when given -rS10
checking section heading parameters when given -rS10
...FAILED
checking subsection heading parameters when given -rS10
checking paragraph parameters when given -rS10
<beginning of page>
foo(1) General Commands Manual foo(1)
Section ps=10.95z, vs=13600u 
 Subsection ps=10.95z, vs=13600u 
 Paragraph ps=10.95z, vs=13600u.
groff test suite ps=10z, vs=12000u 2025-07-25 1
checking header and footer parameters when given -rS11
...FAILED
checking section heading parameters when given -rS11
...FAILED
checking subsection heading parameters when given -rS11
checking paragraph parameters when given -rS11
<beginning of page>
foo(1) General Commands Manual foo(1)
Section ps=12z, vs=14500u 
 Subsection ps=12z, vs=14500u 
 Paragraph ps=12z, vs=14500u.
groff test suite ps=10z, vs=12000u 2025-07-25 1
checking header and footer parameters when given -rS12
...FAILED
checking section heading parameters when given -rS12
...FAILED
checking subsection heading parameters when given -rS12
checking paragraph parameters when given -rS12


So,

A.  we need to actually jack up the section heading type size as promised;
and

B.  we need to apply the body text size to the titles.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67355>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to