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

 
 

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

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

Add a New Comment Rich Markup
   

Tue 08 Mar 2022 04:02:19 AM UTC, comment #5: 

comment #4:

> Why is using the request 'ls' (line spacing) not enough to switch
> between single and double line spacing?


.ls is perfectly fine for this.  But that has no bearing on the fact that the -me manual documents that

  • setting the tv (formerly $v) register is an approved way to change the leading (with much finer control than with .ls), and
  • the hm register sets "the distance from the top of the page to the top of the header."


Utilizing the former documented feature should not break the latter documented functionality.

Dave <barx>
Group Member
Tue 08 Mar 2022 12:26:17 AM UTC, comment #4: 

  Why is using the request 'ls' (line spacing) not enough to switch
between single and double line spacing?

Bjarni Ingi Gislason <bjarniig>
Sun 06 Mar 2022 07:55:52 PM UTC, comment #3: 

The feature requested in bug #61507 might make this bug easier to solve; this bug may be an effect of the behavior Bjarni observed in comment 4 of that bug.  However, using any new groff feature that 61507 introduces would make -me unportable to other roff implementations.

Comment #2 demonstrates that the issue can be resolved using only existing roff.  It might be wordier, but it'll be more portable.

original submission:

> the register $v to specify the line spacing of running text.


Update: this register was renamed to "tv" in response to bug #61710.

Dave <barx>
Group Member
Sat 09 Oct 2021 11:56:25 AM UTC, comment #2: 

For anyone looking for a workaround until this bug is fixed, this is what I've been using.  (This presumes your document is not already redefining the $h macro.)


.\" work around http://savannah.gnu.org/bugs/?60553
.
.rn $h me-header
.de $h
.  nr saved_$v \\n[$v]
.  nr $v 100
.  sz \\n(tp
.  me-header
.  nr $v \\n[saved_$v]
.  sz \\n(tp
.  rr saved_$v
..
.


Dave <barx>
Group Member
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>
Group 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>
Group 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 bjarniig (Posted a comment)
  • -email is unavailable- added by barx (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.

     

    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.13-c54d.
    Corresponding source code