[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: groff injects blank page

From: G. Branden Robinson
Subject: Re: groff injects blank page
Date: Mon, 24 Apr 2023 00:44:38 -0500

Hi Carlos,

At 2023-04-23T11:38:39-0400, Carlos wrote:
> On Sat, Apr 22, 2023 at 04:33:52PM -0500, G. Branden Robinson wrote:
> > At 2023-04-22T16:46:00-0400, Carlos wrote:
> > > Sure. But no one's sure of the cause of the blank page.
> > >
> > > If you had to guess, what would it be?
> >
> > At present my guess is a loose blank line in your
> > /etc/groff/man.local.
> Tsk tsk tsk. Branden Branden.
> Did you say open sesame. In spanish ‹Ábrete sésamo›? It takes some
> effort but it works ;)
> This is it:
> .\" We must use consecutive page numbers when using PostScript to
> .\" generate HTML images, and we must not reset the page number at the
> .\" beginning (the 'ps4html' register is automatically added to the
> .\" command line by the pre-HTML preprocessor).
> .if !r ps4html \
> .  if r P .pn 0\n[P]
> .if !r cR \{\
> .  ie n .nr cR 1
> .  el   .nr cR 1
> .\}

I must caution you that setting the `cR` register (it's short for
"continuous rendering") when the formatter is not in "nroff mode", which
is what the above code does, is going to result in bad typesetting for
PostScript, PDF, DVI, and some more obscure output devices.  But it
won't hurt terminal output, which already uses continuous rendering
(because terminal devices are always in "nroff mode").  The `cR`
register is documented in groff_man(7).  The `ps4html` register is...not
documented.  :-|

> Quite honestly,  I don't understand much of the macros initials,

The requests themselves, `if`, `ie`, `el`, `pn`, and `nr` are documented
in the groff(7) man page and groff's Texinfo manual.

> So I thought: perhaps an-old.tmac would give me some clues, so I went
> there, and cR looked like a candidate,  a nd I just modified the
> values from 0 to 1 and it worked :) But it turns out: it's a
> register!!!
> Ignorance is bliss. I tell you. A register with different values that
> caught my attention. That's funny :)

I think what happened is that by making this change, you masked a bug in

It's okay to claim victory and move on if things are working to your
satisfaction, but the change you made is a hack with undesirable side
effects that you might care about later.  I would add a comment to
yourself in the file documenting the change you made and why.  Six
months from now, if you're trying to format a man page in PDF and it
looks crazy, you'll have an easier time locating the source of the

> Besides, Version 1.23 compiled fine and produced the page/s without
> the blank page why would locales be a problem, I thought.
> But what this confirms in a way, to a certain extent, is that the
> output from what the tty showed at first, correlates with this
> behavior. I think.
> On the other spare system I have, all the files from the tmac dir are
> the same as the ones on Alpine. And an-old.tmac there, odviously shows
> the two values originally as CR 1 and CR 0 and it never produced an
> extra blank page either, whereas with this system  under Alpine,  it
> does. Except version 1.23 of course.

All of the above suggests to me that /etc/groff/man.local, or one of the
macro files, got corrupted on that Alpine Linux system running groff
1.22.4.  I would still look for blank lines in macro files, and make
sure there are none that are harmful.  (A blank line between lines `.ig`
and `..` is harmless as discussed earlier.)

grep '^$' whatever.tmac

> Thank you Branden. I appreciate it.

You're welcome.  If you're happy, I'm happy--but I also fear you'll be
unhappy again in the future if you don't locate the root cause of the


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]