bugGNU roff - Bugs: bug #60422, [ms]: FAM applies too broadly

 
 

bug #60422: [ms]: FAM applies too broadly

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 20 Apr 2021 06:09:38 AM UTC
   
 
Category:  Macro package ms Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 21 Apr 2021 02:19:21 AM UTC, comment #2: 


commit 90e85401af4749809469a1b47e7504b0364fe6f8
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Apr 21 04:28:52 2021 +1000

    tmac/s.tmac: Make FAM string work more sensibly.

    * tmac/s.tmac: Make the FAM string work more sensibly; it now applies to
      headers, footers, and footnotes only if set before the first call of a
      sectioning, paragraphing, or (non-date) document description macro.

      (PT, BT): Set the font family to that saved for titles.

      (fn*do-FS): Set the font family to that saved for footnotes.

      (par@init): Copy the document font family to independent strings for
      titles and footnotes.

      (par@reset): If in a footnote environment, set the font family to that
      saved for footnotes; otherwise use \*[FAM].

    * tmac/groff_ms.7.man (Differences from troff ms/Text settings):
      Describe placement-dependent effect of FAM string setting.

    * doc/groff.texi (Highlighting in ms):
    * doc/ms.ms (Highlighting): As above, and suggest different occasions in
      which ".ds FAM C" and "CW" are convenient.

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


G. Branden Robinson <gbranden>
Group administrator
Tue 20 Apr 2021 06:46:33 PM UTC, comment #1: 

I think I have this nut cracked.

original submission:

> Without having dug into the package internals yet, I would say that:


I have now done said digging.

> 1. ms should use environments for footnotes and titles.


It already does.  They are named 'fn' and 'h', respectively.

> 2. FAM strings for footnotes and titles should be exposed, perhaps FAMFN and FAMHF, or perhaps, I'm inclined to think, package-internal strings since few document authors will desire the effect described above.


I've created these strings.  For now I'm using internal string names and not documenting them.

I've given them more intelligible names than "fn" and "h", though, I think.  :-|

> 3. ms initialization should copy FAMFN and FAMHF from FAM.


Done, modulus the name change.

> 4. FAMFN and FAMHF should be used to determine the font family in the footnote and title environments, respectively.


Ditto.

> 5. A paragraph reset should change only FAM.


This was more interesting since the par@reset macro is used both for regular paragraphs and footnote paragraphs.  Writing a conditional based on the name of the environment got the desired behavior.

G. Branden Robinson <gbranden>
Group administrator
Tue 20 Apr 2021 06:09:38 AM UTC, original submission:  

Changing the FAM string applies too broadly after document initializing.  I noticed this in Deri's new document msboxes.ms.  He used ".ds FAM C" to change the font family before a code example long enough that it spanned a page break.  This seems perfectly in keeping with the string's intention and our advice in ms.ms.

However it also changed the font used in footnotes and titles (headers/footers).

That seems wrong.

I'm attaching a small reproducer in source and rendered form.

Without having dug into the package internals yet, I would say that:

1. ms should use environments for footnotes and titles.
2. FAM strings for footnotes and titles should be exposed, perhaps FAMFN and FAMHF, or perhaps, I'm inclined to think, package-internal strings since few document authors will desire the effect described above.
3. ms initialization should copy FAMFN and FAMHF from FAM.
4. FAMFN and FAMHF should be used to determine the font family in the footnote and title environments, respectively.
5. A paragraph reset should change only FAM.

Thoughts?

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
file #51295:  famfoolery.ms added by gbranden (473B - text/x-troff-ms)
file #51296:  famfoolery.ps added by gbranden (7KiB - application/postscript)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-21 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2021-04-20 gbranden StatusNone In Progress
        Assigned toNone gbranden
    2021-04-20 gbranden Attached File- Added famfoolery.ms, #51295
        Attached File- Added famfoolery.ps, #51296

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code