Bug 14530

Summary: Printed manual pages have extraneous blank first page
Product: Documentation Reporter: Peter Jeremy <jeremyp>
Component: Books & ArticlesAssignee: Alexey Zelkin <phantom>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Peter Jeremy 1999-10-26 04:30:00 UTC
	Printed postscript manual pages start with an extraneous blank
	page.

Fix: gtroff appears to generate extraneous blank output for lines like
.	el .ie "\\$2"3.0"       \c
	This causes the `.Os FreeBSD 3.0' line in the above example (and
	similar lines in many other FreeBSD man pages) to begin a page,
	which is then flushed by one of the later directives (probably
	either .Dt or .Sh).  The following patch changes the logic from
		if (foo1) { } else if (foo2) { } ...
	to
		if (!foo1) if (!foo2) ...
	avoiding the need to insert an empty `then' clause.

	The code for the Fx macro is similar and an equivalent patch
	is appended, though this latter patch hasn't been verified.

	A positive side-effect of the patch is to remove a number of
	"unbalanced .el request" warnings if -ww is enabled.
How-To-Repeat: 
	gzcat /usr/share/man/man3/cam.3.gz | groff -man | lp
	(or send output to ghostscript or similar).
	The first page is blank except for the footer line and the
	actual manual page begins on page 2.
Comment 1 Alexey Zelkin freebsd_committer freebsd_triage 2000-01-10 11:33:21 UTC
Responsible Changed
From-To: freebsd-doc->phantom

I'll be working on this problem. 

Comment 2 peter.jeremy 2000-01-26 20:37:16 UTC
Hi Nik,

In view of the upcoming code freeze for 4.0-RELEASE, could you please
consider applying the following patch, which is an updated version of
the one included in PR docs/14530.  This patch corrects a problem
which causes printed man pages to begin with a blank page.

Index: src/contrib/groff/tmac/doc-common
===================================================================
RCS file: /home/CVSROOT/src/contrib/groff/tmac/doc-common,v
retrieving revision 1.19
diff -u -r1.19 doc-common
--- src/contrib/groff/tmac/doc-common	2000/01/12 10:26:30	1.19
+++ src/contrib/groff/tmac/doc-common	2000/01/13 13:47:19
@@ -231,35 +231,33 @@
 .\}
 .if "\\$1"FreeBSD" \{\
 .	if "\\$2"2"      .ds oS FreeBSD 2.0
-.	    ie \\n(.$==1        \c
-.	el .ie "\\$2"1.0"       \c
-.	el .ie "\\$2"1.1"       \c
-.	el .ie "\\$2"1.1.5"     \c
-.	el .ie "\\$2"1.1.5.1"   \c
-.	el .ie "\\$2"2"         \c
-.	el .ie "\\$2"2.0"       \c
-.	el .ie "\\$2"2.0.5"     \c
-.	el .ie "\\$2"2.1"       \c
-.	el .ie "\\$2"2.1.5"     \c
-.	el .ie "\\$2"2.1.6"     \c
-.	el .ie "\\$2"2.1.7"     \c
-.	el .ie "\\$2"2.2"       \c
-.	el .ie "\\$2"2.2.1"     \c
-.	el .ie "\\$2"2.2.2"     \c
-.	el .ie "\\$2"2.2.5"     \c
-.	el .ie "\\$2"2.2.6"     \c
-.	el .ie "\\$2"2.2.7"     \c
-.	el .ie "\\$2"2.2.8"     \c
-.	el .ie "\\$2"3"         \c
-.	el .ie "\\$2"3.0"       \c
-.	el .ie "\\$2"3.1"       \c
-.	el .ie "\\$2"3.2"       \c
-.	el .ie "\\$2"3.3"       \c
-.	el .ie "\\$2"3.4"       \c
-.	el .ie "\\$2"3.5"       \c
-.	el .ie "\\$2"4"         \c
-.	el .ie "\\$2"4.0"       \c
-.	el .tm Unknown FreeBSD version ``\\$2'' at line \\n(c.
+.	if !\\n(.$==1        \
+.	if !"\\$2"1.0"       \
+.	if !"\\$2"1.1"       \
+.	if !"\\$2"1.1.5"     \
+.	if !"\\$2"1.1.5.1"   \
+.	if !"\\$2"2"         \
+.	if !"\\$2"2.0"       \
+.	if !"\\$2"2.0.5"     \
+.	if !"\\$2"2.1"       \
+.	if !"\\$2"2.1.5"     \
+.	if !"\\$2"2.1.6"     \
+.	if !"\\$2"2.1.7"     \
+.	if !"\\$2"2.2"       \
+.	if !"\\$2"2.2.1"     \
+.	if !"\\$2"2.2.2"     \
+.	if !"\\$2"2.2.5"     \
+.	if !"\\$2"2.2.6"     \
+.	if !"\\$2"2.2.7"     \
+.	if !"\\$2"2.2.8"     \
+.	if !"\\$2"3.0"       \
+.	if !"\\$2"3.1"       \
+.	if !"\\$2"3.2"       \
+.	if !"\\$2"3.3"       \
+.	if !"\\$2"3.4"       \
+.	if !"\\$2"3.5"       \
+.	if !"\\$2"4.0"       \
+.	tm Unknown FreeBSD version ``\\$2'' at line \\n(c.
 .\}
 .if "\\*(oS"Null" \{\
 .	ds oS \&\\$1
Index: src/contrib/groff/tmac/doc-syms
===================================================================
RCS file: /home/CVSROOT/src/contrib/groff/tmac/doc-syms,v
retrieving revision 1.24
diff -u -r1.24 doc-syms
--- src/contrib/groff/tmac/doc-syms	2000/01/12 10:26:30	1.24
+++ src/contrib/groff/tmac/doc-syms	2000/01/13 13:47:19
@@ -161,31 +161,31 @@
 .ds aa \&\f\\n(cF\s\\n(cZ
 .ds ab \& \&
 .    ie \\n(.$==0       .rm ab
-.el .ie "\\$1"1.0"      \c
-.el .ie "\\$1"1.1"      \c
-.el .ie "\\$1"1.1.5"    \c
-.el .ie "\\$1"1.1.5.1"  \c
-.el .ie "\\$1"2.0"      \c
-.el .ie "\\$1"2.0.5"    \c
-.el .ie "\\$1"2.1"      \c
-.el .ie "\\$1"2.1.5"    \c
-.el .ie "\\$1"2.1.6"    \c
-.el .ie "\\$1"2.1.7"    \c
-.el .ie "\\$1"2.2"      \c
-.el .ie "\\$1"2.2.1"    \c
-.el .ie "\\$1"2.2.2"    \c
-.el .ie "\\$1"2.2.5"    \c
-.el .ie "\\$1"2.2.6"    \c
-.el .ie "\\$1"2.2.7"    \c
-.el .ie "\\$1"2.2.8"    \c
-.el .ie "\\$1"3.0"      \c
-.el .ie "\\$1"3.1"      \c
-.el .ie "\\$1"3.2"      \c
-.el .ie "\\$1"3.3"      \c
-.el .ie "\\$1"3.4"      \c
-.el .ie "\\$1"3.5"      \c
-.el .ie "\\$1"4.0"      \c
-.el .ie "\\$1","        .rm ab \" Allow ".Fx ,"
+.el .if !"\\$1"1.0"     \
+.    if !"\\$1"1.1"     \
+.    if !"\\$1"1.1.5"   \
+.    if !"\\$1"1.1.5.1" \
+.    if !"\\$1"2.0"     \
+.    if !"\\$1"2.0.5"   \
+.    if !"\\$1"2.1"     \
+.    if !"\\$1"2.1.5"   \
+.    if !"\\$1"2.1.6"   \
+.    if !"\\$1"2.1.7"   \
+.    if !"\\$1"2.2"     \
+.    if !"\\$1"2.2.1"   \
+.    if !"\\$1"2.2.2"   \
+.    if !"\\$1"2.2.5"   \
+.    if !"\\$1"2.2.6"   \
+.    if !"\\$1"2.2.7"   \
+.    if !"\\$1"2.2.8"   \
+.    if !"\\$1"3.0"     \
+.    if !"\\$1"3.1"     \
+.    if !"\\$1"3.2"     \
+.    if !"\\$1"3.3"     \
+.    if !"\\$1"3.4"     \
+.    if !"\\$1"3.5"     \
+.    if !"\\$1"4.0"     \
+.    ie "\\$1","        .rm ab \" Allow ".Fx ,"
 .el .ie "\\$1"."        .rm ab \" Allow ".Fx ."
 .el .tm Unknown FreeBSD version ``\\$1'' at line \\n(c.
 \&\\*(tNFreeBSD\\*(aa\\*(ab\\$1\\$2

Peter
Comment 3 nik freebsd_committer freebsd_triage 2000-10-29 21:00:48 UTC
State Changed
From-To: open->closed

Fixed.  I think this was by Joerg in 1.20 of contrib/groff/tmac/doc-common. 
Thanks for the PR.