groff
[Top][All Lists]
Advanced

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

Re: [Groff] developers only?


From: Tadziu Hoffmann
Subject: Re: [Groff] developers only?
Date: Wed, 30 Mar 2005 00:47:38 +0200
User-agent: Mutt/1.5.6i

> I'm printing the lyrics of a CD; I want it in 2-col; so I did
> 
>       .2c
>       .nf
> 
> I wanted groff to *not* join short lines but break long lines;
> Short lines were not joined, ok!
> But groff did not break the long lines :-))
> - Long lines in the first column invaded the second column
> - Long lines in the second column were truncated
> 
> How do I get groff to split but don't join?
> 
> I'm using -me and groff 1.17.2 (debian stable);


This is actually nontrivial.  Groff handles split & join (.fi)
and nosplit & nojoin (.nf), but not split & nojoin -- at least
not by itself, so we have to help it along a bit.  Here is a
somewhat crude method which has the disadvantage that you have
to precede every line with some text (i.e., .xx), but gives a
more pleasing output because each wrapped line is indented.
If you don't like the extra macro per line, the next step of
sophistication might be a higher-level macro that reads an
input line of text (using, e.g., an input line count trap)
and formats that line, repeating until it reaches some end
condition.


---- cut here ----
.2c
.fi
This is just some comaprison text to demonstrate the width of
the column.

.de xx
.br
.ti 0
\&\\$*
..
.in +2m
.xx A normal-length line of my favorite song
.xx A very very very very very very very very long line of my favorite song
.xx A short line
.xx A normal-length line of my favorite song
.in -2m
---- cut here ----






reply via email to

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