groff
[Top][All Lists]
Advanced

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

[Groff] Re: fill/diversion query


From: Dean Allen Provins
Subject: [Groff] Re: fill/diversion query
Date: Wed, 2 Feb 2000 08:11:10 -0700 (MST)

Ted:

I tried your suggestion (moving .nf outside, and using macro
definition instead of diversion).  Naturally it works.  I'm still
curious about the newline/space issue though.

Tonight I'll go back to the UNIX Text Processing book to see what I missed.
Apparently I misunderstood what I was reading.

Thanks for your help.

Dean Provins
Calgary

PS:  The HOWTO is coming, although slowly.  I write a section each
weekend, and have 3/4 to go.  I noticed in recent post (possibly by
Eddie), that you may have written a TROFF document.  If so, may I see a
copy?

-----------------------

> Hi Dean,
> 
> A detailed explanation of the mechanism producing your output
> escapes me for the moment, though I'm interested to find out and
> will be investigating.
> 
> The main explanation, however, is that what gets put into a diversion
> is _processed_ output, not the input. Namely:
> 
>   .di xx     Divert output to macro xx. Normal text processing occurs
>              during diversion except that page offsetting is not done.
>              ...
> 
> I suspect that the detailed explanation has to do with the line-breaks
> in the input getting processed twice over, turning them into spaces
> each time: once when the input is processed for the first time as it
> goes into the diversion, and then again as it comes back out ... Don't
> quote me on that yet, though!
> 
> It is possible to vary the unwanted effects by juggling with your
> original source, but not to do away with them altogether.
> 
> The way to get it as it should be is to make a proper macro out
> of the source text as such. Then (on my system) it works fine.
> It's also a good idea (for your demo) to leave the nf and fi
> commands outside the macro.
> 
> I have re-written your source below to show this. (You can use
> .my_test or \*[my_test] equivalently here).
> 
> By the way, spaces had crept in at the ends of a couple of your
> lines, though they don't seem to produce any visible effect: I have
> replaced these by ! to show where they were.
> 
> I hope this helps.
> Ted.


reply via email to

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