> Consider the followin short man page:
>
> $ cat manpage.1
> \" comment
> .TH MANPAGE 1 "2006 Oct 1" "manpage"
> .SH NAME
> manpage \- test man page
>
> This has a bug: the first line (with the comment) should start with
> a dot. For example, the man page bash.1 has this bug.
>
> Without the dot, this line produces an empty space in the output.
> In text or html output, this space is a single empty line, ok.
>
> But in ps or dvi output, a whole empty page is created. I consider
> this a bug in ps and dvi mode.
Two observations.
. Reason for the difference between troff and nroff mode is the
command line register \n[cR]: If set, a single, very long page is
produced instead of multiple pages. This is the default for nroff
mode.
. The man macros are able to handle more than a single man page.
For example, you can say
groff -man foo.1 bar.1
In troff mode, each man page starts with a new page.
The code which checks whether it is necessary to start a new page
is as follows (slightly simplified):
.if (\\n[nl] > 0) \
. bp
Right after a `.bp' request, the `nl' register is set to -1. With
other words, the above code snippet prevents that we accidentally
get two consecutive `.bp' requests.
I think this explains the behaviour you've encountered.
> If you write some text before the .TH request this text is written
> in a single line even in ps or dvi output.
Actually, I think this is a buglet, because it 1) should cause a page
break and 2) it spoils the first header line.
> But as soon as you add a line that is empty or has only spaces or a
> comment a whole empty page is created in ps or dvi mode.
This is rather a feature.
I don't know whether it is worth the effort to implement fixes for
both cases. In case someone wants to work on it: Patches welcome!
Werner
_______________________________________________
Groff mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/groff