groff
[Top][All Lists]
Advanced

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

Re: [Groff] Line continuation


From: Miklos Somogyi
Subject: Re: [Groff] Line continuation
Date: Sun, 26 Oct 2008 22:02:50 +1100


Hello Ralph,

Since I need to do this thing far too many times, your idea of a preprocessor seems just great. I don't know about sed but wrote a few scripts in perl (or Perl?), so this would be an easy job.

And it could be placed under the jurisdiction of my groff alias that does a couple of other things anyway.
Thanks for the idea very much.

Regards,

Miklos

On 26/10/2008, at 09:26 PM, Ralph Corderoy wrote:


Hi Miklos,

   xxx  yyyy  wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
   xxx  yyyy  wwwwwwwwwwwwwwwwww
   xxx  yyyy  wwwwwwwwwwwwwwwwwwwwwwwwwwwwww\
   wwwwwwwwwwwwwww
   xxx   yyyy  wwwwwwwwwwwwwwwwwwwwwww

I would like to push the remainder of wwwww to the right so as not to
obscure the xxx yyyy structure and ask groff to please disregard all
these leading spaces alongside with the  linefeed.

I'd be tempted to have a simple preprocessor that joins these lines up
before groff seems them.

   $ cat miklos
   line 1
   line 2
   line 3 contin--
                ued here.
   line 4 also carr--
                   ies on, --
                           and on, --
                                   and on.
   line 5 is at the end of the file--
   $ sed ':l;/--$/{N;s/--\n *//;b l}' <miklos
   line 1
   line 2
   line 3 continued here.
   line 4 also carries on, and on, and on.
   line 5 is at the end of the file--
   $

I've used `--' at the end of the line to try and avoid trampling on
anything else, but it's simple to change.

Cheers,


Ralph.








reply via email to

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