Bug 18233

Summary: man and nroff -mdoc produce extra blank lines.
Product: Documentation Reporter: Thomas Dean <tomdean>
Component: Books & ArticlesAssignee: Jeroen Ruigrok van der Werven <asmodai>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Thomas Dean 2000-04-26 16:20:01 UTC
'man make' has extra (doubled) blank lines in it.  Several other
man pages have extra blank lines in them.  The template man page
with only .Sh and .Pp plus pain text [A-Za-z]* in it will contain
extra blank lines.  'nroff -man' and 'nroff -mdoc' both exhibit
the problem.

How-To-Repeat: 
The following script will produce a nroff source file that will
duplicate the problem.  'xx.sh > xx.1' followed by 'nroff -mdoc xx.1'
The output will have an extra blank line at line number 66.  Pipe
the output of nroff into 'grep -n ".*"' to see line numbers.
If the number of sections is increased from 10 to 30, lines
66, 132, 198, etc will be extra blank lines.  If xx.1 is placed in
the MANPATH, 'man xx' will produce the problem.

#! /bin/sh
# generate a man page which will have an extra blank line
cat <<EOF
.Dd DATE
.Os
.Dt XX 1
.Sh NAME
.Nm xx
.Nd This will produce blank line errors.
EOF
section=0
paragraph=0
while [ $section -lt 10 ]; do
    echo ".Sh Section Number ${section}"
    section=`expr ${section} + 1`
    n=0
    while [ $n -lt 3 ]; do
	echo "This is paragraph ${paragraph}."
	echo ".Pp"
	paragraph=`expr ${paragraph} + 1`
	n=`expr $n + 1`
    done
done
Comment 1 Mike Pritchard 2000-04-26 18:17:48 UTC
On Wed, Apr 26, 2000 at 08:18:33AM -0700, Thomas D. Dean wrote:
> >Synopsis:       man and nroff -mdoc produce extra blank lines.
> >Description:
> 'man make' has extra (doubled) blank lines in it.  Several other
> man pages have extra blank lines in them.  The template man page
> with only .Sh and .Pp plus pain text [A-Za-z]* in it will contain
> extra blank lines.  'nroff -man' and 'nroff -mdoc' both exhibit
> the problem.
> 
> >How-To-Repeat:
> 
> The following script will produce a nroff source file that will
> duplicate the problem.  'xx.sh > xx.1' followed by 'nroff -mdoc xx.1'
> The output will have an extra blank line at line number 66.  Pipe
> the output of nroff into 'grep -n ".*"' to see line numbers.
> If the number of sections is increased from 10 to 30, lines
> 66, 132, 198, etc will be extra blank lines.  If xx.1 is placed in
> the MANPATH, 'man xx' will produce the problem.

The extra blank lines are at page breaks within the man page.
66 lines of text is one printed page of output.  132 lines of text
is two pages of text, etc.  

-Mike
-- 
Mike Pritchard
mpp@FreeBSD.org or mpp@mppsystems.com
Comment 2 hoek freebsd_committer freebsd_triage 2000-05-13 15:45:22 UTC
State Changed
From-To: open->closed

As per mpp's explanation: the blank lines are occurring at page 
breaks by intention. 

Comment 3 Thomas Dean 2000-05-16 02:58:37 UTC
The behavior of page breaks depends on context.  Adding a line to a
man page can change the behavior, from having one extra blank line to
not having extra blank lines.

tomdean


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
Comment 4 Tim Vanderhoek 2000-05-16 03:27:04 UTC
On Mon, May 15, 2000 at 06:58:37PM -0700, Thomas D. Dean wrote:
>
> The behavior of page breaks depends on context.  Adding a line to a
> man page can change the behavior, from having one extra blank line to
> not having extra blank lines.

I'll need you to give me an example where the output is incorrect.


-- 
Signature withheld by request of author.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
Comment 5 Thomas Dean 2000-05-16 03:58:37 UTC
I have included two examples.

The first has EXTRA blank lines at page boundaries.

The second has three blank lines after after the line 'bin directory':

FILES
     src/Makefile              A make file that will build a project in the
                               bin directory.



     src/project_name.c        The main() function.

tomdean

===== example 1 ==========
#! /bin/sh

# generate a man page which will have extra blank lines

cat <<EOF
.Dd DATE
.Os
.Dt XX_TEST 1
.Sh NAME
.Nm xx_test
.Nd This will produce blank line errors.
EOF

section=0
    paragraph=0

while [ $section -lt 30 ]; do
    echo ".Sh Section Number ${section}"
    section=`expr ${section} + 1`
    n=0
    while [ $n -lt 3 ]; do
        echo "This is paragraph ${paragraph}."
        echo ".Pp"
        paragraph=`expr ${paragraph} + 1`
        n=`expr $n + 1`
    done
done

==== example 2 ============
.\" Copyright (c)
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.Dd April 23, 2000
.Dt APPL_SETUP 1
.Os FreeBSD 3.4
.Sh NAME
.Nm appl_setup
.Nd An application development tree maintenance tool.
.Sh SYNOPSIS
.Nm
.Op Fl a Ar component
.Op Fl Cc
.Op Fl f Ar file_name Ar include_file
.Op Fl h
.Op Fl i Ar file_name
.Op Fl l
.Op Fl m Ar man_section
.Op Fl p Ar project_name
.Sh DESCRIPTION
.Nm
is a perl script that aids in creating and managing application development
trees.
.Sh OPTIONS
The options are as follows:
.Bl -tag -width "-f file name include file"
.It Fl a Ar component
Add a component to the directory tree.
.Bl -tag -width "library" -compact
.It Library
Add a library sub-directory to the project tree.
.It Include
Add a include sub-directory to the project tree.
.El
.It Fl C
Create a
.Sy C++
project.  Not implemented.
.It Fl c
Import the project into
.Sy CVS
as version 0.9.0.
.It Fl f Ar file_name Ar include_file
.Pp
create a new source file named
.Pa file_name.c
including
.Pa include_file.h.
The source file will have a integer function named
.Fn file_name
The author is the output of
.Sy whoami.
If specified,
.Fl p
will create a source file with a
.Fn main
function.
.It Fl h
Help.
.It Fl i Ar file_name
create a new c type include file named
.Pa file_name.h.
The include file will have a standard comment header and
and the #ifdef ...  #endif brackets to prevent multiple inclusion
.It Fl l
create a library sub-directory
The default is to not create the library sub-directory
.It Fl m Ar man_section_number
create a man page for man.number.  The default is to not create the
man page.
.It Fl p Ar project_name
Create a new project named project_name.
The project will be created at the current directory level and have a tree
consisting of the bin, include, obj, and, src directories.
A file containing a main function will be created, named project_name.c
.El
.Sh ENVIRONMENT
The
.Nm
command ignores the
.Ev APPL_SETUP
environment variable.
.Sh FILES
.Bl -tag -width "include/project_name.def"
.It Pa src/Makefile
A make file that will build a project in the bin directory.
.It Pa src/project_name.c
The
.Fn main
function.
.It Pa include/project_name.h
The primary local include file.
.It Pa include/project_name.def
A message and return code definitio file.  See
.Pa bin/mkError.awk
and
.Pa bin/mkErrorStr.awk.
.It Pa obj/Makefile
A link to
.Pa src/Makefile.
.It Pa bin/mkError.awk
The awk script to build definitions from a definition file.
.It Pa bin/mkErrorStr.awk
The awk script to build error message definitions from a definition
file.
.El
.Sh EXAMPLES
.Nm
.Fl p Ar myProject
.Pp
This command will create a project tree in the current directory.  The
project tree will consist of bin, include, obj, and, src directories.
The src directory will contain a Makefile and myProject.c main
application.  The include directory will contain a myProject.h The
Makefile will not allow making in the src directory.  The obj
directory contains a Makefile, linked to
.Pa ../src/Makefile.
The result
of make will produce an executable named myProject in the bin
directory.
.Sh DIAGNOSTICS
Exit status is 0 on success, and negative if the command
fails for one of the following reasons
.Sh COMPATIBILITY
The
.Nm
command has no known compatibility issues.
.Sh SEE ALSO
.Sh STANDARDS
.Sh HISTORY
.Sh AUTHORS
This
manual page was written by
.An Thomas D. Dean
.Sh BUGS
.Nm
is in its infancy.
.Nm
will create a workable application development tree.
Maintenance functions are missing.
.Sh TODO
I need help in designing
.Nm
What functionality is needed?  Desireable?


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
Comment 6 Tim Vanderhoek 2000-05-17 22:42:08 UTC
On Mon, May 15, 2000 at 07:58:37PM -0700, Thomas D. Dean wrote:
>
> I have included two examples.
> 
> The first has EXTRA blank lines at page boundaries.
> 
> The second has three blank lines after after the line 'bin directory':

Well, I can't explain what's going on, but I'm not quite convinced
it's a bug, either.  I played with troff a little, and have confirmed
that their are 66 lines_per_page, which doesn't help much.  I'll
re-open the PR, but maybe James Clark, author of groff, would be a
better resource for this problem.


-- 
Signature withheld by request of author.
Comment 7 hoek freebsd_committer freebsd_triage 2000-05-17 22:42:12 UTC
State Changed
From-To: closed->open

It's not clear what's going on at page breaks.  That doesn't necessarily 
mean it's a bug, but I am curious to know what's going on. 

Comment 8 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-05-29 22:04:23 UTC
State Changed
From-To: open->analyzed

I am already on the case. 

Just for info, the blank line happens after line 66.  Does 
that ring a bell? =) 

It's the pagebreak.  Now to find where it messes that up. 


Comment 9 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-05-29 22:04:23 UTC
Responsible Changed
From-To: freebsd-doc->asmodai

On the case.
Comment 10 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-10-30 13:48:45 UTC
State Changed
From-To: analyzed->closed

ru or phantom committed a fix to both CURRENT and STABLE.