bugGNU roff - Bugs: bug #62688, [ms] inter-display distance...

 
 

bug #62688: [ms] inter-display distance accumulates with other vertical space--it should not

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Fri 01 Jul 2022 03:53:25 AM UTC
   
 
Category:  Macro ms Severity:  2 - Minor
Item Group:  Rendering/Cosmetics Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 10 Jul 2023 08:37:24 AM UTC, comment #2: 

Further improved for groff 1.24.0.


commit 49d7b7afa8a4758a8a74483e2832dc214b160df8
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed May 10 02:06:18 2023 -0500

    tmac/s.tmac: Turn on no-space mode in `PE` macro.

    * tmac/s.tmac (PE): Turn on no-space mode after a pic(1) display, when
      not flying back with `PF`.  Continues fix for Savannah #62688.


G. Branden Robinson <gbranden>
Group administrator
Wed 06 Jul 2022 07:48:07 PM UTC, comment #1: 


commit 783f3c2745b8132a9b7fa99bd1b241d2e34f4398
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Jul 6 14:17:44 2022 -0500

    [ms]: Fix Savannah #62688.

    * tmac/s.tmac (DE): Set no-space mode when ending displays.

      (@EN): Set no-space mode after outputting the display distance
      so that it doesn't combine with inter-paragraph space.

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

    Discovered while formatting Kernighan & Cherry's "Typesetting
    Mathematics -- User's Guide (Second Edition) from the Unix V7
    Programmer's Manual.


G. Branden Robinson <gbranden>
Group administrator
Fri 01 Jul 2022 03:53:25 AM UTC, original submission:  

If you stick one display right next to another, both display distances will be applied to the document.  This shouldn't happen.

Equations have a similar problem.


$ cat EXPERIMENTS/DD2.ms
.LP
This is a paragraph.
.DS
Here is a display.
.DE
.DS
Here is another display.
.DE
.EQ
a + b = c
.EN
.EQ
x + y = z
.EN
.LP
Here's another paragraph.
.EQ
j + k = l
.EN
How much vertical space did we get?
.pl \n(nlu


Output:


$ nroff -ms EXPERIMENTS/DD2.ms






This is a paragraph.

     Here is a display.


     Here is another display.


                          a + b = c


                          x + y = z


Here’s another paragraph.

                          j + k = l

How much vertical space did we get?


Patch:


diff --git a/tmac/s.tmac b/tmac/s.tmac
index f72a8d698..9ef9b42be 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -976,6 +976,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .de DE
 .ds*end!\\n[\\n[.ev]:ds-type]
 .nr \\n[.ev]:ds-type 0
+.ns
 ..
 .de ds@auto-end
 .if \\n[\\n[.ev]:ds-type] \{\
@@ -1884,6 +1885,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .      if !'\\*[eqn*num]'' .nr eqn*have-num 1
 .      ie \\n[dl]:\\n[eqn*have-num] \{\
 .              sp \\n[DD]u
+.              ns
 .              par@reset
 .              ds eqn*tabs \\n[.tabs]
 .              nf
@@ -1912,6 +1914,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .              \}
 .\".           if !'\*(.T'html' .sp \\n[DD]u
 .              sp \\n[DD]u
+.              ns
 .              ta \\*[eqn*tabs]
 .      \}
 .      el \{\


Result:


$ ./build/test-groff -Tutf8 -ms EXPERIMENTS/DD2.ms






This is a paragraph.

     Here is a display.

     Here is another display.

                          a + b = c

                          x + y = z

Here’s another paragraph.

                          j + k = l

How much vertical space did we get?


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 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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-07-06 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.23.0

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code