bugGNU roff - Bugs: bug #59605, [PATCH] [ms] Add FR string to...

 
 

bug #59605: [PATCH] [ms] Add FR string to express a ratio of footnote line length ratio base line length

Submitter:  T. Kurt Bond <tkurtbond>
Submitted:  Wed 02 Dec 2020 09:33:42 PM UTC
   
 
Category:  Macro ms Severity:  3 - Normal
Item Group:  Feature change Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 29 Jan 2021 09:23:00 PM UTC, comment #5: 


commit 7ededa13fab44eb517e98ff50eec75c4137fbcf5
Author: T. Kurt Bond <tkurtbond@gmail.com>
Date:   Wed Dec 2 21:33:42 2020 +0000

    [ms]: Add string FR for footnote ratio expression.

    [ms]: Add new string FR to hold an expression for computing the footnote
    length relative to the line length, consistently for single- and
    multi-column modes, which \n[FL] has never done.

    * tmac/s.tmac: Initialize FR string to "11/12".
      (@MC): Compute footnote column width using \*[FR] instead of a
      hard-coded "11/12" expression.
      (par@init): Compute default \n[FL] using \*[FR] instead of a
      hard-coded "11/12" expression.

    * doc/groff.texi (Macro Packages/ms/Document control settings):
    * tmac/groff_ms.7.man (Usage/Document control registers): Document it.

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


G. Branden Robinson <gbranden>
Group administrator
Fri 29 Jan 2021 12:45:18 PM UTC, comment #4: 

comment #3:

> Ooh, burn.


OK, that could be phrased more tactfully than what I wrote.

11/12 is such an idiosyncratic default that I have to wonder about its origins.  One coder's personal preference that he didn't realize would remain enshrined into law four decades on?  A requirement for a specific journal?  A practical joke gotten out of hand?

The story of how it then got corrupted to 5/6 must be equally compelling.  History Channel should do a special.

Dave <barx>
Group Member
Thu 28 Jan 2021 09:39:33 AM UTC, comment #3: 

comment #2:

> In general, default values should be reasonable, and users should be able to assume that they can safely use the defaults unless they have reason to override them.


Agreed.

> Thus it's well worth pointing out in the documentation that ms defaults to 11/12 solely for back compatibility, but that this value matches no real-world typesetting practice.


Ooh, burn.  But, yes, it's worth documenting.

> For conventional typesetting the user should set this value to 1.


Okay.  This can be suggested as well.

We haven't heard from Kurt on this.  He, Ingo, Colin, and Bertrand all seem to have been eaten by the New Year... <fearful emoji>

I'll proceed, so we can regard this item as "in progress", but I'd still like to hear back from Kurt.

G. Branden Robinson <gbranden>
Group administrator
Tue 26 Jan 2021 05:49:09 AM UTC, comment #2: 

In general, default values should be reasonable, and users should be able to assume that they can safely use the defaults unless they have reason to override them.  Thus it's well worth pointing out in the documentation that ms defaults to 11/12 solely for back compatibility, but that this value matches no real-world typesetting practice.  For conventional typesetting the user should set this value to 1.

Dave <barx>
Group Member
Wed 06 Jan 2021 01:44:41 AM UTC, comment #1: 

Hi Kurt,

It was a little difficult for me to fully grasp the motivation for your patch.  At first it seemed like you were "merely" indirecting the 5/6 (now 11/12) expression for computing FL into a string.

But now that I look over your patch, I think this is the heart of it:


diff --git a/tmac/s.tmac b/tmac/s.tmac
index 180a9f81..8f03878f 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -514,7 +514,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .DEVTAG ".mc \\n[pg@ncols] \\n[pg@colw] \\n[pg*gutw]"
 .ns
 .nr pg*col-num 0
-.nr pg@fn-colw \\n[pg@colw]*5/6
+.nr pg@fn-colw \\n[pg@colw]*\\*[FR]
 .par@reset
 .mk pg*col-top
 ..


The above causes footnote column widths to be computed using the same proportion as is applied to FL for single-column text.

Is that correct?

If so, and if we encourage groff ms document authors to use the FR string in favor of the FL register, I think your proposal is a design win.

I believe you covered this ground in https://lists.gnu.org/archive/html/groff/2020-11/msg00077.html but I didn't fully absorb it at the time.

I am inlining your entire patch below and interleaving it with comments.


diff --git a/doc/groff.texi b/doc/groff.texi
index 75b08a5f..f72bda49 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -2774,6 +2774,15 @@ Effective: next footnote.
 Default: @math{@code{@\n[PD]} / 2}.
 @endDefmpreg

+@DefstrList {FR, ms}
+Defines the ratio of the footnote line length to the current line
+length.
+
+Effective: start of document or before each @code{.MC} or @code{.2C}.
+
+Default: @math{5/6}.
+@endDefmpreg
+
 @unnumberedsubsubsec Miscellaneous Number Registers

 @Defmpreg {MINGW, ms}


The above 5/6 should change to 11/12 per my recent change for compatibility with other ms implementations and Lesk 1978-11-13.

We probably also want to note that FR is the preferred method of setting the footnote length, steering people away from fooling with the FL register.  We should continue to support the latter for backward compatibility, of course.


diff --git a/tmac/groff_ms.7.man b/tmac/groff_ms.7.man
index 83a6cefc..858ad699 100644
--- a/tmac/groff_ms.7.man
+++ b/tmac/groff_ms.7.man
@@ -235,15 +235,23 @@ cb   cb cb cb
 lfCW l  l  l.
 Reg.        Definition        Effective        Default
 _
-FL        Footnote length        next footnote        \[rs]n[LL]*5/6
+FL        Footnote length        T{
+next footnote; not effective in multicolumn mode
+T}        \[rs]n[LL]*\[rs]*[FR]
 FI        Footnote indent        next footnote        2n
 FF        Footnote format        next footnote        0
 FPS        Point size        next footnote        \[rs]n[PS]\-2
 FVS        Vert.\& spacing        next footnote        \[rs]n[FPS]+2
 FPD        Para.\& spacing        next footnote        \[rs]n[PD]/2
+FR        Footnote ratio        T{
+before first paragraph, or before each .MC
+T}        5/6
 _
 .TE
 .RE
+.LP
+Note that \f[CW]FR\fP is a string variable and should be set with  the
+\fBds\fP request.
 .
 .LP
 .ne 7


I have some thoughts about rearranging the above, but they're mixed in with the work on ms.ms that I need to return to.


diff --git a/tmac/s.tmac b/tmac/s.tmac
index 180a9f81..8f03878f 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -514,7 +514,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .DEVTAG ".mc \\n[pg@ncols] \\n[pg@colw] \\n[pg*gutw]"
 .ns
 .nr pg*col-num 0
-.nr pg@fn-colw \\n[pg@colw]*5/6
+.nr pg@fn-colw \\n[pg@colw]*\\*[FR]
 .par@reset
 .mk pg*col-top
 ..


As noted above, I believe this to be the "heart" of the patch.

I further note that I missed updating this occurrence of 5/6 to 11/12 in 0c7e84cc3c87407bef0d3de0c7b54ee8d3a47e23, largely because I did not understand how column widths and footnote lengths in columns were computed.  I may fix that before returning to this issue.  It will help make the DRY principle problem in the current implementation more obvious.


@@ -1077,7 +1077,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\" happens when the first page begins
 .de par@init
 .if !rLT .nr LT \\n[LL]
-.if !rFL .nr FL \\n[LL]*5/6
+.if !rFL .nr FL \\n[LL]*\\*[FR]
 .if !rVS \{\
 .        ie (\\n[PS] >= 1000) \
 .                nr VS (\\n[PS] + 2000)


This is the counterpart for single-column text, and already changed by me from 5/6 to 11/12 in the aforementioned commit.


@@ -1419,7 +1419,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\" but allow ".SH n" to make heading point size match ".NH n",
 .\" for same "n", when \n[GROWPS] and \n[PSINCR] are set.
 .  nr sh*psincr 0
-.  if 0\\$1>0 .nr sh*psincr (\\n[GROWPS]-0\\$1)*\\n[PSINCR]
+.  if 0\\$1>0 \{\
+.    nr sh*psincr (\\n[GROWPS]-0\\$1)*\\n[PSINCR]
+.\}
 .  SH-NO-TAG
 .  DEVTAG-SH 1
 .  if '\*(.T'html' .nr need_eo_h 1


The above looks like a formatting tweak, not strictly related?

The braces are not necessary, as only one control line is executed if the conditional is true.  Also, the line is not too long.


@@ -1498,6 +1500,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .ds par@sup-end \v'-.7m\s0+.9m'
 .als } par@sup-end
 .\" footnote paragraphs
+.\" FR is the footnote ratio to the line length
+.ds FR 5/6
 .\" FF is the footnote format
 .nr FF 0
 .\" This can be redefined. It gets a second argument of 'no' if the


...and the above actually sets the ratio.  So it would become 11/12 as well.

I don't need an updated version of the patch--I simply wanted to get your feedback and confirm with you that I have understood matters correctly.

Regards,
Branden

G. Branden Robinson <gbranden>
Group administrator
Wed 02 Dec 2020 09:33:42 PM UTC, original submission:  

I don't like having the line length of the footnotes only 5/6 the
width of the columns: I like them to be the full width of the current
line, whether that is in one column mode or multicolumn mode.  I'd
like to be able to change that default, to avoid having to change the
footnote line length in multicolumn mode using the undocumented
fn:MCLL.

I propose adding a string variable, FR (footnote ratio), that defaults
to to 5/6 for compatibility and replaces the uses of the literal 5/6
for setting footnote line length.  You can set this at the beginning
of your document, or before each .MC or .2C.  For my use I'd always
set it to 1, making the footnote line length the same as the line
length.

(I think making setting FR effective before the next footnote, like
setting FL in one column mode, would take rewriting par@reset to
recalculate fn:MCLL every time, instead of just after a .MC.)

I've included a patch that makes the necessary changes in groff.texi, groff_ms.7.man, and s.tmac.

T. Kurt Bond <tkurtbond>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50382:  footnote-ratio.patch added by tkurtbond (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by tkurtbond (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-05 gbranden Summary[PATCH] [ms] Add FR string variable to modify the footnote line length ratio to the current line length [PATCH] [ms] Add FR string to express a ratio of footnote line length ratio base line length
    2021-01-29 gbranden StatusNeed Info Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2021-01-28 gbranden Assigned toNone gbranden
    2021-01-06 gbranden StatusNone Need Info
        Summary[PATCH] Add FR string variable to modify the footnote line length ratio to the current line length [PATCH] [ms] Add FR string variable to modify the footnote line length ratio to the current line length
    2020-12-02 barx Carbon-CopyRemoved 93119 -
    2020-12-02 barx SummaryAdd FR string variable to modify the footnote line length ratio to the current line length [PATCH] Add FR string variable to modify the footnote line length ratio to the current line length
    2020-12-02 tkurtbond Attached File- Added footnote-ratio.patch, #50382

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code