[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Coming back with my crazy macros !
From: |
Thomas Baruchel |
Subject: |
Re: [Groff] Coming back with my crazy macros ! |
Date: |
Tue, 5 Jun 2001 22:52:38 +0200 |
User-agent: |
Mutt/1.2.5i |
On Tue, Jun 05, 2001 at 09:56:09AM +0200, Werner LEMBERG wrote:
> > You may think it isn't useful, since .unformat does the same
> > thing, but it isn't true (I don't think that you can use the
> > .it input trap between each word of a paragraph after
> > .unformat).
> Correct. BTW, have you tried the `.de xx yy' solution
Yes, this was in fact my first solution (several months ago), but I found
several things I didn't like. Here are my four 'compatible' solution with
what I didn't like in them (except the last one).
The purpose is to have a semi-formatted diversion, in order to study the lines
before formatting the paragraph.
a) Defining a paragraph as a macro with .de
--> nice and easy but:
- not very nice if you have something like:
.nr note 0
.de x
This is a nice paragraph
.nr note +1
(\n[note]).
..
You see what I mean: the macro will contain everything, even
some requests that shouldn't be executed several times...
- You have your text in an unformatted way, but you don't
know anything about it.
b) Diverting the paragraph with a word on each line without using the
.br request.
b.1) Printing the text on very short lines (1u)
--> very bad idea, no comment
b.2) Using a very great value with .ss
--> Better but not fully compatible
b.3) Forcing each word to be printed on the next line by putting
huge spaces before each one (without keeping the spaces in the
diversion).
I will soon send more, but I want first to define a full set of macros
to handle with my semi-formatted paragraphs, in order to have good tools
before writing my new macros. I will begin to write:
.( xx [indent] Starting a semi-formatted diversion called xx with
a first-line indent of [indent]
.^) [break] Ending a semi-formatted diversion and putting or not a
break at the end.
.^i xx [indent] Adding or removing the first line indent of a diversion.
.^n xx NN Count the number of blocks (words separated by stretchable
spaces) in the block and put this nulber in NN.
Detect if the diversion has a break at the and and tell it
in an readable internal register.
.^p xx Remove (pop) the last block (or the break) at the end of
a diversion.
.^c xx yy zz Concatenate xx and yy in order to have zz.
Example: .^( xx
This is a
.^)
.^( yy
paragraph
.^)
.^c xx yy zz
.zz
will handle exactly has if you have typed:
This is a paragraph
(and the stretchable spaces will handle exactly as in
this case).
.^r xx yy Revert xx in order to create yy with the blocks in reverse
order (not very useful except for my purpose of formatting
backward the paragraph).
Do I need to tell that everything (including the backward formatting)
should work in compatible mode and should work with ascii output as well
as postscript ?
> I'm very interested to see your results!
wait and see...
--
,--._
.'o `-.__
| (~' ~~--.__
),-.' `. '' ,, ~`-.
// \ ( ,, ,, '' `) Thomas Baruchel
// `. `. ,, ,,'' .'
// ~. `._,, ,' <address@hidden>
' _tb_ `-.___.,-~'
\ \ Brest
_/ _/