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 11:22:38 +1100


On 26/10/2008, at 02:44 AM, Larry Kollar wrote:


Miklos Somogyi wrote:

When one needs to break a long line, the continuation needs to start at the beginning
of the next line. This spoils the readability of the file.
I would like to have something like this:

xxx   yyyy  wwwwwwwwwwwwwwwwwwwwwwww\X
                  wwwwwwwwww

where \X would cause groff to ignore the newline as well as the leading spaces of the next line.

I think you want \: which inserts a zero-width space. You can put in as many as you want at different points in the string where a break would look good. So if you have, say, a long URL, you could format it like this:

.CW "http://foo.example.org/\:some_directory/\:a_sub_dir/ \:sub_sub_dir/\:flowchart.png"

If the URL hits the margin, groff puts the break after the / closest to the margin without going over.


Larry, this is a good idea for breaking up a string at convenient places automatically with \& and I make a note of this for future reference.
But perhaps I did not express myself clearly.
In no-fill mode I can print more than 80 characters per line. To handle this either I set my terminal wider (and it will overlap with others, not good), or I break the line using the escape character.

In the latter case I need to start the remainder at the beginning of the next line. That would make my groff source
less readable:

   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 hope that it is clearer now, and I hope that somebody has already created an escape like this. Btw, is it possible to create new escapes in any other way than programming them into the groff source code?

Miklos

Hope that helps,

-- Larry







reply via email to

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