[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] horizontal trap
From: |
Peter Schaffter |
Subject: |
Re: [Groff] horizontal trap |
Date: |
Sun, 27 Dec 2015 13:38:01 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sat, Dec 26, 2015, Dave wrote:
> Here's what I'm trying to do. I have a lengthy input file to be
> processed in no-fill mode. For 99% of this file, that will work
> just fine: that is, the input lines will fit within the the page.
> A few lines, however, are too long for the page, and in no-fill
> mode groff happily sends them past the margin and even past the
> edge of the paper.
>
> I don't want groff to handle these lines; the exact way each such
> line should be handled depends on a number of factors and really
> requires manual intervention. But I do want groff to alert me to
> such cases, so that I know where to find them without having to
> flip through a couple hundred pages of output.
Since you're in no-fill mode, it's a perfect job for the little-used
input line trap request. This should do what you want.
.de foo
. it 1 bar
. di baz
..
.
.de bar
. di
. if \\n[dl]>\\n[.l] \
. tm Line \\n[.c] exceeds width.
. baz
. foo
..
.
.de bat
.di
..
.
.em bat
.
.ll 4i
.nf
.foo
First line of text.
Second line of text.
etc.
Any line exceeding 4i will be reported. The .em (bat) prevents
groff from complaining about the final diversion being incomplete.
--
Peter Schaffter
http://www.schaffter.ca
- [Groff] horizontal trap, Dave, 2015/12/26
- Re: [Groff] horizontal trap, Ralph Corderoy, 2015/12/27
- Re: [Groff] horizontal trap,
Peter Schaffter <=
- Re: [Groff] horizontal trap, Ralph Corderoy, 2015/12/28
- Re: [Groff] horizontal trap, Tadziu Hoffmann, 2015/12/28
- Re: [Groff] horizontal trap, Tadziu Hoffmann, 2015/12/28
- Re: [Groff] horizontal trap, Ralph Corderoy, 2015/12/29
- Re: [Groff] horizontal trap, Ralph Corderoy, 2015/12/29
- Re: [Groff] horizontal trap, Tadziu Hoffmann, 2015/12/30
- Re: [Groff] horizontal trap, Steffen Nurpmeso, 2015/12/31
Re: [Groff] horizontal trap, Carsten Kunze, 2015/12/28