bug-groff
[Top][All Lists]
Advanced

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

nroff mode paging inconsistencies


From: Chuck Jungmann
Subject: nroff mode paging inconsistencies
Date: Fri, 10 May 2024 13:17:28 -0500
User-agent: Mozilla Thunderbird

A macro I wrote exhibited rare misaligned formatting. While debugging it, I discovered some inconsistencies with page dimensions and offsets that I didn't expect from nroff output to a pager.

The alleged (maybe I don't understand something) inconsistencies pertain to values of various registers.  The register for page offset (\n[.o]) always reports a 0 value, as one would expect for an unpaged document.  I eventually figured out that I was near the bottom of a page by using the .mk action, which does report a vertical offset from a given page (though not the same value as \n[.o] in a document formatted with troff).  Comparing the .mk value with the page height register (\n[.p]), I could see that my formatting problem occurred when I attempted to .sp up to a line that was printed before a phantom page break.

Using .mk to isolate the problem also suggests a work-around. Use the value reported by .mk in place of the page offset register.  Easier still would be to detect nroff mode and if in nroff, just issue a .bp before every multi-line object since .bp seems to have no effect on the output beyond resetting the position reported by the .mk action.

I sent this bug report to make a record of the issue in case it helps someone diagnose and work-around a similar problem.  I'm not sure if this is something you would work on.  In reading the 10-year-old mission statement, this issue doesn't apply to either of the two areas of development.  If you want more information, I would be happy to provide more information and a simplified roff-script to manifest the problem.

I'm not sure how you'd fix it, and maybe you can't.  Having a page offset from the top of the document risks integer overflow, especially with troff output where the my pdf line height is 12,000 basic units, so I can see an argument for having virtual pages to limit the internal page offset value as reported by .mk.





reply via email to

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