bug-groff
[Top][All Lists]
Advanced

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

A4 page size woes


From: joerg van den hoff
Subject: A4 page size woes
Date: Sun, 17 Jul 2022 15:36:26 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

not sure whether this qualifies as a bug or is "known behaviour":

my groff installation uses A4 paper size per default (and the DESC file of 
grops indeed says so much).

using the ms macros, I noted that when setting the page size to A4 in groff as 
well (either manually
or via including a4.tmac) does lead to quite pronounced apparent misplacement of footers (much nearer to paper edge than headers).

playing around with this a it seems that the reason simply is that troff (or 
ms?) introduces
a vertical offset at paper top and counts page length relative to that offset.

accordingly one must reduce .pl by twice that offset in order to get 
footer/header equidistant
to the lower/upper paper edge. empirically the offset is *very* close to 1P 
(1/6 inch). maybe
this does mean something (e.g. to stay away from dead zone at paper edge where laser printers wont print)?

the attached snippet should demonstrate the described issue.

questions:
is this known behaviour?
am I overlooking the obvious and doing (or expecting) something wrong?
is it specific to `ms'?
is it documented?
should .pl in a4.tmac account for this offset by using 29.71c-2P rather than 
29.71c?

in any case, currently simply setting page (groff) and paper size (grops) both 
simply to A4
does not really work quite as it should (due to shifting footers about 1cm 
nearer to the page
edge than the header).

thank you
joerg

.\"------------------------------------------------------------------------
.pl 29.71c-0.86c
.\" or maybe the really correct setting would be .pl 29.71c-2P
.pn +2
.ds RH >>>
.ds CH H
.ds LH <<<
.ds RF >>>
.ds CF F
.ds LF <<<
.nr PO 1.0i
.nr LL 21c-\n[PO]-\n[PO]
.nr LT \n(LL
.nr PS 14
.nr VS 17
.\"
.sp |\n[HM]u
\D'l \n[LL]u 0'
.vpt 0
.sp |\n[.p]u-\n[FM]u
\D'l \n[LL]u 0'
.sp |0u
\D'p 0 \n[.p]u \n[LL]u 0 0 -\n[.p]u'
.sp |\n[HM]u+1i
.DS I
.nr h \n[.p]/72000*72000
.nr f \n[.p]-\nh
.nr h \nh/72000
.nr f \nf/72
.nr w \n[LL]+\n[PO]+\n[PO]
.nr x \nw/72000*72000
.nr d \nw-\nx
.nr x \nw/72000
.nr d \nd/72
pl: \n[.p]u (=\nh.\nfi. A4 paper height is 29.71c=11.697i)
HM: \n[HM]u
FM: \n[FM]u
PO: \n[PO]u
LL: \n[LL]u
LT: \n[LT]u
page width from LL+2*PO: \nx.\ndi  (A4 paper width is 21c = 8.267i)
.DE
.QP
The vertical extend/height of the box is identical to .pl and width identical 
to LL. The
box is supposed to start at postion 0 in the upper left corner.
.QP
The page height has to be set to a value distinctly smaller than A4 paper 
height in order
to get symmetrical top and bottom margins (and headers/footers).
The practical reason seems to be that vertical
position 0 at top of page has a finite offset from actual page/paper edge. 
Accordingly
\&.pl must be reduced to account for this offset. Empirically the offset 
(distant of
upper box boundary from paper edge) amounts to about 0.43c Accordingly \&.pl 
needs to be
reduced by 0.86cm relative to true A4 height.
.QP
Incidentally, the offset of 0.43c turns out to be nearly exactly identical to 1 
pica
(1/6i). Whether or not this is relevant (by indicating some hard-coded 1P 
offset in the
depths of troff or ms) is unclear.
.vpt 1
.\"------------------------------------------------------------------------



reply via email to

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