Bug 435453 - Errors with man -t formatting of ps man page
Summary: Errors with man -t formatting of ps man page
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: procps
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tomas Smetana
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-29 14:17 UTC by Matt Thompson
Modified: 2008-09-01 10:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-01 10:16:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Example PDF made from ps manpage via man -t (41.36 KB, application/pdf)
2008-02-29 14:17 UTC, Matt Thompson
no flags Details
ps manpage created via groff pipestream (28.97 KB, application/pdf)
2008-02-29 14:49 UTC, Matt Thompson
no flags Details

Description Matt Thompson 2008-02-29 14:17:39 UTC
Description of problem:
When one tries to make a PostScript (or PDF) version of the ps manpage, errors
crop up leading to a bad PS file.

Version-Release number of selected component (if applicable):
procps-3.2.7-17.fc8.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. man -t ps > trial.ps
2.
3.
  
Actual results:
> man -t ps > trial.ps
<standard input>:947: numeric overflow
<standard input>:1391: numeric overflow
<SNIP about 90 numeric overflows>
<standard input>:1391: numeric overflow
<standard input>:1404: addition overflow

Also, upon viewing the PostScript file (or a pdf formed using "man -t ps |
ps2pdf - trial.pdf; attached herein), the errors may be found on pages 10-14. 
You can see that some of the entries are running off the edge of the page.  It
looks like some wordwrap algorithm with gtbl isn't quite working.

Expected results:
A properly formatted PostScript file.

Additional info:
I have attached a PDF file made by the technique above.  Also, I wasn't sure who
to file this bug with.  I can see it being a procpc, man, or groff problem.

Comment 1 Matt Thompson 2008-02-29 14:17:39 UTC
Created attachment 296353 [details]
Example PDF made from ps manpage via man -t

Comment 2 Tomas Smetana 2008-02-29 14:44:11 UTC
Will check with the 'man' package maintainer.  I'm not sure the bug is in
procps.  I think man (groff?) should format the pages the same way as on the
screen.  And in a terminal it looks OK.

Comment 3 Matt Thompson 2008-02-29 14:48:57 UTC
Thanks, I wasn't sure, but yeah it does appear correctly in terminal.  One other
thing I tried was based on an old webpage I found.  It used a command similar to
the one below to format pages for Xman.  So, I tried it with a different -T
command for groff.  Namely:

> gunzip -c /usr/share/man/man1/ps.1.gz | gtbl | geqn | gtbl | groff -Tps
-mandoc | ps2pdf - ps.manpage.pdf
gtbl:<standard input>:761: `.' not last character on line
gtbl:<standard input>:761: giving up on this table
gtbl:<standard input>:1490: `.' not last character on line
gtbl:<standard input>:1490: giving up on this table
gtbl:<standard input>:2014: `.' not last character on line
gtbl:<standard input>:2014: giving up on this table
gtbl:<standard input>:8020: `.' not last character on line
gtbl:<standard input>:8020: giving up on this table

Using this pipe-stream does indeed rid the errors.  Unfortunately it does so by
essentially stripping out the offending tables.  Just for reference, I am
attaching the PDF created with this method.



Comment 4 Matt Thompson 2008-02-29 14:49:34 UTC
Created attachment 296358 [details]
ps manpage created via groff pipestream

Comment 5 Tomas Smetana 2008-03-14 11:55:57 UTC
Reassigning to man.

Comment 6 Ivana Varekova 2008-03-20 10:02:51 UTC
As is seen from the comment #3 this is not man problem - this is groff problem
man uses command 
cd /usr/share/man && /usr/bin/gunzip -c '/usr/share/man/man1/ps.1.gz' |
/usr/bin/gtbl | /usr/bin/groff -Tps -mandoc >trial.ps
which causes it.

Comment 7 Tomas Smetana 2008-03-20 10:13:19 UTC
Weird thing is that "man -t ps" and "groff -Tps -mandoc" will result in
different documents when run on ps.1.  How comes?

Comment 8 Marcela Mašláňová 2008-03-20 12:44:44 UTC
'cause man use some nrof -Something.

If you'll try to read this man page with mc, then you see another problems. This
man page has incorrect characters in table of contents (page 10 and next) and
that is the reason of all problems.


Comment 9 Tomas Smetana 2008-03-27 07:43:21 UTC
Marcela found out that the problem is caused by the following line:

.nr ColSize ((\n(.lu-\n(.iu/\n(.Hu-20u)n)

rewriting it to

.nr ColSize ((\n[.l] - \n[.i]) / 1n - 20)

seems to solve the problem.  I'll add this change to the next procps update.






Note You need to log in before you can comment on or make changes to this bug.