Bug 144043

Summary: groff silently defaults page length to A4 without general way to reconfigure it
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: groffAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-01 13:24:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
sample troff code which prints too high on a letter paper none

Description Michal Jaegermann 2005-01-04 00:36:22 UTC
Description of problem:

To dispell on the start any doubts 'locale -k LC_PAPER' on my machine
happens to print

height=279
width=216

which is a USletter size (for A4 that would be height=297, width=210).
Despite of that if one will do, for example and on attached demo,

      groff -Tps -p chemstructs.pict

then viewing results, or printing, on a letter paper will have the
topmost structure cut in half.  After a check of a generated PS this
is not suprise as in it there is 'def/PL 841.89', which is an A4 paper
height in Postscript points.

It turns out, which if far from clear from the man page, that one
can work around by doing

     groff -Tps -P -g chemstructs.pict

which "guesses" page size and which works fine, or explicitely

     groff -Tps -P -pletter chemstructs.pict

after which one see 'def/PL 792' as wanted here.  Unfortunately
it does not look that one can set a desired default.  In such
situation one would think that a "guessing" code should be used
unless some specific paper size was requested and not something
which in many locations will come up wrong.

The same issues actually affects 'man' as well.  Pages printed
with 'man -t ...' on a letter paper are loosing a running head
(which is not that obvious until one looks closer).  That particular
case likely can be worked around by putting into /etc/man.config

TROFF           groff -Tps -man -P -g

instead of the current line but I do not see something similar
for the general case.

Version-Release number of selected component (if applicable):
groff-1.18.1.1-3

Comment 1 Michal Jaegermann 2005-01-04 00:39:12 UTC
Created attachment 109304 [details]
sample troff code which prints too high on a letter paper

Comment 2 Michal Jaegermann 2005-09-03 23:47:30 UTC
This bug not only sits as NEW for the last nine months but is also present
in the current groff-1.18.1.1-5 from development series.  It seems that
"guessing" should be really a default with an explicit size specification
as an override.

TROFF command in /etc/man.config from man-1.5p-6 (development too) also
does not provide a workaround but that should not be needed with groff
honouring a locale information.

Comment 3 Miroslav Lichvar 2006-02-01 13:24:39 UTC
Groff looks for paper size in /etc/papersize file, just run "echo letter >
/etc/papersize" and it should be ok.

Comment 4 Michal Jaegermann 2006-02-01 16:21:44 UTC
> Groff looks for paper size in /etc/papersize file

Documentation is very far from that claim. 'man groff' does not mention
anything of that sort.  In 'info groff', if one knows what to look for, it
is possible to find:

   Alternatively, STRING can be a file name (e.g. `/etc/papersize');

in a format description of DESC files.  So this STRING can be anything else
or may not show up at all.