[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Suppressing final page break
From: |
Clarke Echols |
Subject: |
Re: [Groff] Suppressing final page break |
Date: |
Wed, 05 Feb 2014 21:58:05 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 |
On 02/05/2014 09:10 PM, Austin wrote:
Hope you'll forgive my first post being a dumb newbie question ... I have
searched for an answer with no luck so far.
I have a pair of macros that collect text and format it, then output one chunk
per page, for printing envelopes, labels, etc. I'm looking for a more elegant
way of suppressing the final page break to avoid an empty page at the end of
the document. Currently I set a 'first time through' flag and then output the
page break depending on its value, but this seems slightly kludgy. Is there
perhaps a way of making the .bp 'conditional', i.e. only actioned if there is
text following it? Or perhaps a way to 'suck it back' in an end-of-input
macro? What's the preferred approach (if there is one)?
I usually print files with embedded .bp requests and make sure I have
no empty lines at the end of the file.
The .em request is provided to handle end-of-input conditions, but
that's usually to set up signature/approval blocks after everything
else is finished printing.
This might work:
1. Set a flag to indicate start of job to prevent an initial .bp
2. Have the first macro on the first entry emit a .bp before
producing any other output, then clear the flag for subsequent
passes/pages.
3. The last page input starts with a page break, but when there's no
more input, the first macro isn't entered, and thus suppresses
the page break.
That should do it.