bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #59605] [PATCH] [ms] Add FR string variable to modify the footnote


From: G. Branden Robinson
Subject: [bug #59605] [PATCH] [ms] Add FR string variable to modify the footnote line length ratio to the current line length
Date: Tue, 5 Jan 2021 20:44:41 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Update of bug #59605 (project groff):

                  Status:                    None => 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

    _______________________________________________________

Follow-up 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

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]