[Top][All Lists]

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

Re: groff injects blank page

From: Carlos
Subject: Re: groff injects blank page
Date: Sun, 23 Apr 2023 11:38:39 -0400

On Sat, Apr 22, 2023 at 04:33:52PM -0500, G. Branden Robinson wrote:
> Hi Carlos,
> At 2023-04-22T16:46:00-0400, Carlos wrote:
> > On Sat, Apr 22, 2023 at 03:00:34PM -0500, G. Branden Robinson wrote:
> > > At 2023-04-22T12:36:51-0400, Carlos wrote:
> > > > How am I supposed to give you an example? 
> > > 
> > > For a guy who likes manually constructing pipelines, Ralph seems
> > > inordinately disinterested in the intermediate stages when
> > > troubleshooting.  ;-)
> > > 
> > > Unfortunately the PostScript output you've been sharing is not terribly
> > > helpful; please hold off for now.  Your "nroff -man | cat -n" output is
> > > the most telling clue we have so far, in my opinion.
> > 
> > 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

Quite honestly,  I don't understand much of the macros initials, but
I had checked and it made no sense to keep looking there
for `.TH`. `TH` was the issue, but what else was there, if It was an
iteration  over and over and over

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 thought of locales in the very beginning and after reading man roff
but wasn't quite sure this was the shortcut to take.

Besides, Version 1.23 compiled fine and produced the page/s without the blank 
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.

Thank you Branden. I appreciate it. 

> > > It might be worth comparing the /etc/groff/man.local files in both
> > > your main distribution (which you haven't identified) and Alpine
> > > Linux.
> > 
> > I'll check.
> > 
> > If on the other hand, I were to compare the stats from groff and
> > the other spare machine where no blank page is injected, then it'd
> > alnost be like cheating the way out to find the cause, which is not
> > fair either for a blank page. Just joking. But I'll check. 
> > 
> > It's interesting nonetheless.
> [...]
> > > The groff_man(7) man page will tell you exactly where the man.local
> > > file is installed.  View the man page and scroll down to the "Files"
> > > section.
> > 
> > Did you mean groff man(7) or roff or man(7) man. Sorry but I couldn't
> > find the section or subsection titled Files
> I mean groff_man(7) with the underscore.
> $ MANWIDTH=72 man groff_man | sed -n '/^FILES/,/^NOTES/p'
>        /usr/share/groff/1.22.4/tmac/man.tmac
>        /usr/share/groff/1.22.4/tmac/an.tmac
>               These are wrapper files to call andoc.tmac.
>        /usr/share/groff/1.22.4/tmac/andoc.tmac
>               This brief groff program detects whether the man or mdoc
>               macro package is being used by a document and loads  the
>               correct  macro definitions, taking advantage of the fact
>               that pages using them must  call  .TH  or  .Dd,  respec‐
>               tively,  as  their  first  macro.   Because the wrappers
>               above load this file, a man program or user typing,  for
>               example,  “groff -man page.1”, need not know which pack‐
>               age the file page.1 uses.  Multiple man pages, in either
>               format, can be handled.
>        /usr/share/groff/1.22.4/tmac/an-old.tmac
>               Most  man  macros  are  contained in this file.  It also
>               loads the GNU extensions from an-ext.tmac (see below).
>        /usr/share/groff/1.22.4/tmac/an-ext.tmac
>               The extension macro definitions for .SY, .OP, .YS,  .TQ,
>               .EX/.EE,  .UR/.UE,  and  .MT/.ME  are  contained in this
>               file, which is written in classic troff and permissively
>               licensed—not  copylefted.   Man  page  authors concerned
>               about portability to legacy Unix systems are  encouraged
>               to  copy  these  definitions into their pages, and main‐
>               tainers of troff implementations or  work‐alike  systems
>               that format man pages are encouraged to re‐use them.
>               Note  that the definitions for these macros are read af‐
>               ter the call of .TH, so they will replace any macros  of
>               the  same  names  preceding it in your file.  If you use
>               your own implementations of these macros, they  must  be
>               defined after calling .TH to have any effect.
>        /usr/share/groff/site-tmac/man.local
>               Local changes and customizations should be put into this
>               file.
> (On my Debian system, /usr/share/groff/site-tmac is a symbolic link to
> /etc/groff.  Nothing wrong with that.)
> Regards,
> Branden


reply via email to

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