bugGNU roff - Bugs: bug #61025, [me] want control of line height...

 
 

bug #61025: [me] want control of line height alteration when super-, subscripting

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 10 Aug 2021 01:46:01 PM UTC
   
 
Category:  Macro me 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
   

Jump to the original submission

Mon 03 Jan 2022 08:59:08 AM UTC, comment #10: 


commit 1652d1801d4b2518db9c3d6834561a8d26eacf48
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Jan 3 07:41:32 2022 +1100

    [me]: Drop unnecessary code.

    Apart from being superfluous, it prevented a user-defined value of the
    `sx` register from being applied to the first footnote marker
    interpolated, a subtlety that escaped my notice because the first
    footnotes in our "meref" and "meintro" documents are not numeric, but
    symbolic, and their markers occurred on lines with vertical space above
    and below.  (The bug was further masked by an otherwise redundant
    redefinition of the `*` string inside the `)f` macro.)

    * tmac/e.tmac ()f, +c): Stop redefining footnote marker string `*` after
      updating the automatic footnote number; its interpolation is already
      backslash-protected.

      ()d, pd): Stop redefining delayed text marker string `#` for an
      analogous reason.

      (initialization): Drop unneeded `_*` and `_#` strings.

    Thanks to Robert Goulding for his feedback and patience.  See
    <https://savannah.gnu.org/bugs/?61025>.


G. Branden Robinson <gbranden>
Group administrator
Sun 02 Jan 2022 08:19:05 PM UTC, comment #9: 

We're still not quite there yet.

See <https://lists.gnu.org/archive/html/bug-groff/2022-01/msg00010.html>
and
<https://lists.gnu.org/archive/html/bug-groff/2022-01/msg00011.html>.

The `_*` string can go, as can the resets of `*` in the `+c` and `)f`
macros; since the interpolation of the `$f` register is already guarded
by a backslash layer, the footnote number won't be interpolated too
early.

G. Branden Robinson <gbranden>
Group administrator
Sun 02 Jan 2022 03:44:43 PM UTC, comment #8: 


commit 3e9210e4a8b297766f1d9a41d0568e8cba2827a7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Dec 28 19:44:16 2021 +1100

    [me]: Rename new `$x` register to `sx`.

    Since we expect the user to set this register directly, it should not be
    named with a leading '$' per the "me Reference Manual".

    * tmac/e.tmac (initialization, {, }): Do it.

    * tmac/groff_me.7.man:
    * doc/meref.me.in:
    * NEWS: Update documentation.

    * doc/meintro.me.in:
    * doc/meintro_fr.me.in:
    * doc/meref.me.in: Sync with new register name.

    See <https://savannah.gnu.org/bugs/?61025>.  Thanks to Dave Kemper for
    the discussion in <https://savannah.gnu.org/bugs/?61710>.


G. Branden Robinson <gbranden>
Group administrator
Tue 28 Dec 2021 04:00:54 AM UTC, comment #7: 

Excuse me.  I was struck by temporary blindness.


.nr ss 12p                      \" section prespacing


So I'll pick something else.

G. Branden Robinson <gbranden>
Group administrator
Tue 28 Dec 2021 03:58:11 AM UTC, comment #6: 

Reopening.  Discussions with Dave Kemper have underscored to me
the importance of honoring the me(7) package's naming
convention.

This means that, unless I want to expose a macro to manipulate
the `$x` register (and I don't), I should rename it to
advertise itself as user-fiddlable per the introduction of the
"me Reference Manual".

`ss`, which one can read as 'super/subscript space', is
available in the name space and seems pretty mnemonic.

G. Branden Robinson <gbranden>
Group administrator
Thu 16 Dec 2021 06:53:48 PM UTC, comment #5: 

comment #4:

> commit cced48abddb73762bcfe414c9de42cc1324126fd
> Author: G. Branden Robinson <g.branden.robinson@gmail.com>
> Date:   Thu Dec 16 18:37:45 2021 +1100


(For the historical record: it is commit 6eafd2084b9172fc132335fc6a22dc516d0d88b2 that fixed this.  Git calls the above-quoted commit ID a "bad object," though that seems overly judgmental.)

Dave <barx>
Group Member
Thu 16 Dec 2021 12:14:36 PM UTC, comment #4: 


commit cced48abddb73762bcfe414c9de42cc1324126fd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Thu Dec 16 18:37:45 2021 +1100

    [me]: Parameterize super/subscript line ht adjust.

    * tmac/e.tmac (initialization): Assign 0.2m to register `$x`.2m.

      ({, <}: Apply adjustment, multiplied by -1 for superscripts.

    * doc/meref.me.in:
    * tmac/groff_me.7.man: Document it.

    * NEWS: Add item.

    * doc/meintro.me.in:
    * doc/meintro_fr.me.in:
    * doc/meref.me.in: Forego extra line height for more attractive
      typesetting.

    Fixes <https://savannah.gnu.org/bugs/?61025>.  Thanks to Robert Goulding
    for the suggestion.


G. Branden Robinson <gbranden>
Group administrator
Thu 16 Dec 2021 07:10:21 AM UTC, comment #3: 

And for those who enjoy their popcorn while watching arguments on the groff mailing lists, we see here another example of ems being used to measure vertical space.


diff --git a/tmac/e.tmac b/tmac/e.tmac
index 8a03b1c02..3317226bf 100644
--- a/tmac/e.tmac
+++ b/tmac/e.tmac
@@ -1971,6 +1971,7 @@
 .
 .nr $v \n(.v00+\n(.sp-1/\n(.sp \" vs as % of ps for .sz request
 .nr $V \n($v                   \" same for displays & footnotes
+.nr $x 0.2m                    \" super/subscript line height increase
 .nr hm 4v                      \" header margin
 .nr tm 7v                      \" top margin
 .nr bm 6v                      \" bottom margin
@@ -1992,22 +1993,22 @@
 .nr ss 12p                     \" section prespacing
 .nr si 0                       \" section indent
 .
+.@R 0x\" set by GNU pic to _disable_ \x in super/scripting
 .
 .\"            *** OTHER INITIALIZATION ***
 .
-.
-.\" GNU pic sets this register to 1 to indicate that \x should not be
-.\" used.
-.@R 0x
 .\" Define strings for super- and subscripting.  groff me does not
 .\" bother with half-line motions in nroff mode, since we have no output
 .\" driver (for that mode) that supports them; consequently we don't
 .\" emit \x escape sequences in that case either.  If someone implements
 .\" a Model 37 or line printer emulator we can target, this decision
 .\" could be revisited.
+.\"
+.\" Adjust the line height with \x if the `0x` register is zero (a
+.\" pic(1) convention) by the amount in `$x` (a groff 1.23 extension).
 .ie t \
 \{\
-.ds { \v'-0.4m'\x'\\n(0x=0*-0.2m'\s-3
+.ds { \v'-0.4m'\x'\\n(0x=0*-\\n($xu'\s-3
 .ds } \s+3\v'0.4m'
 .\}
 .el \
@@ -2028,7 +2029,7 @@
 .\}
 .ie t \
 \{\
-.ds < \v'0.4m'\x'\\n(0x=0*0.2m'\s-3
+.ds < \v'0.4m'\x'\\n(0x=0*\\n($xu'\s-3
 .ds > \s+3\v'-0.4m'
 .\}
 .el \


G. Branden Robinson <gbranden>
Group administrator
Thu 16 Dec 2021 07:07:02 AM UTC, comment #2: 


comment #1:

> I propose to add a new me(7) Boolean-valued register, $x, to enable this behavior, and to switch it off by default.


This plan didn't quite survive contact with the enemy--the enemy being our (groff's) `@R` macro which initializes registers, but only to zero, and also the fact that it was the only outright Boolean that we would have been exposing via the register interface.

So $x is the amount of space by which to increase the line height instead.  This has the advantage of parameterizing a rendering factor that a hard-coded literal before.  (If you wanted a different adjustment, you had to redefine the super/subscripting strings.)

For backward-compatibility purists, this approach also has the advantage of not changing how documents render.

I'm adding `.nr $x 0` to our in-tree me(7) documents, though.

G. Branden Robinson <gbranden>
Group administrator
Sun 05 Dec 2021 10:48:24 PM UTC, comment #1: 

The current behavior is in fact how me(7) is documented to work and has been for a long time; see, e.g., the 4.4BSD meref.me; however, I agree that this should be configurable (in fact there is a hidden knob register, "0x" that pic(1) uses to turn it off), and moreover that the default is ugly and inconsistent with modern typesetting practices.

I propose to add a new me(7) Boolean-valued register, $x, to enable this behavior, and to switch it off by default.  It will be _and_ed with 0x in the super- and subscripting string definitions in troff mode.

G. Branden Robinson <gbranden>
Group administrator
Tue 10 Aug 2021 01:46:01 PM UTC, original submission:  

Robert Goulding reported suboptimal rendering to the groff mailing list.

https://lists.gnu.org/archive/html/groff/2021-08/msg00055.html


I have always disliked the way that that macro set added line
spacing to accommodate the footnote marker. Maybe that was
necessary in older output devices; but it looks very ugly in
modern laser printed output. I've redefined the footnote marker
for -me thus:

.ds { \v'-.9m\s'\En[.s]*7u/10u'+.7m'
.ds } \v'-.7m\s0+.9m'
.ds * \*{1\*}\k*


The present definition is:


.\" GNU pic sets this register to 1 to indicate that \x should not be
.\" used.
.@R 0x
.ds { \v'-0.4m'\x'\\n(0x=0*-0.2m'\s-3
.ds } \s+3\v'0.4m'
.\" for compatibility with traditional -me
.\" (the first will work only in compatibility mode)
.ds [ \*{
.ds ] \*}
.ds < \v'0.4m'\x'\\n(0x=0*0.2m'\s-3
.ds > \s+3\v'-0.4m'


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:
   

No files currently attached

 

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 (original reporter)
  • -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 16 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-03 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2022-01-02 gbranden StatusFixed In Progress
        Open/ClosedClosed Open
    2022-01-02 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2021-12-28 gbranden Open/ClosedClosed Open
    2021-12-28 gbranden StatusFixed In Progress
    2021-12-16 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0
    2021-12-05 gbranden Item GroupIncorrect behaviour Feature change
        StatusNone In Progress
        Assigned toNone gbranden
        Summary[me] adjusts line heights when using superscripting [me] want control of line height alteration when super-, subscripting
    2021-08-11 gbranden Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code