bugGNU troff - Bugs: bug #60553, [me] changing line spacing alters...

 
 

bug #60553: [me] changing line spacing alters header vertical placement

Submitted by:  Dave <barx>
Submitted on:  Sat 08 May 2021 04:57:51 AM UTC  
 
Category:  Macro - me Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 08 May 2021 11:52:31 PM UTC, comment #1: 

The bug occurs when using any of -me's three header macros (.he, .eh, or .oh).  Happily, there is no corresponding bug in the footer when any of the three analogous footer macros (.fo, .ef, or .of) are used.

Dave <barx>
Project Member
Sat 08 May 2021 04:57:51 AM UTC, original submission:  

The -me macro set uses the register $v to specify the line spacing of running text.  However, changing the value of this register also changes the vertical placement of the header.

This is illustrated by a simple test file.

.mso e.tmac
.
.he ''Header'    \" set header text
.nr $v 120       \" set line-spacing register
.sz \n(pp        \" make $v take effect
.
.pp

(The above value for $v, 120, is the default value -me uses if none is specified.)  Changing the number on the ".nr $v" line changes the header's vertical location.  Small changes aren't visible to the naked eye, though looking at the generated PostScript code shows the slight shift:

$ diff <(groff me.test) <(sed s/120/140/ me.test | groff)
233c233
< /F0 10/Times-Bold@0 SF(Header)272.17 60 Q 0 Cg EP
---
> /F0 10/Times-Bold@0 SF(Header)272.17 62 Q 0 Cg EP

For a more dramatic shift, look at the rendered output when $v is 120 and again when it's 240, effectively double spacing.  This changes the header position by essentially a line's full height.

This is almost never what a user wants: a document might switch back and forth between single and double spacing over the course of several pages, but the location of the header should not drift up and down on different pages.

Further, the -me documentation states that the register hm controls "the distance from the top of the page to the top of the header."  Changing $v makes this no longer true, so the observed behavior violates the documentation as well as common-sense expectation.

Dave <barx>
Project Member

 

(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 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-04 barx Summarychanging line spacing alters header vertical placement => [me] changing line spacing alters header vertical placement

    Back to the top


    Powered by Savane 3.6