Re: [Groff] Hanging paragraphs in MM

2010-06-03 Thread Anton Shepelev
On 3 Jun 2010 at 10:01, Ralph Corderoy wrote: > > Hi Anton, > > > The trap is set by .it 1 an-trap, so I why is it > > fired after the section text even is it was passed > > to .SH as parameter? Are macro parameters handled > > as input lines? > > No, I think you'll find it's this line, > >

Re: [Groff] Hanging paragraphs in MM

2010-06-03 Thread Anton Shepelev
> Ah, yes. In the manpage macros, this works similarly: all > paragraph macros reset the indent to what it "should" be > (so that any ".in" invocations within a paragraph will be > undone at the beginning of the next paragraph). That is, > ".TP" absolutely sets the indent to "something" + "extra"

Re: [Groff] Hanging paragraphs in MM

2010-06-03 Thread Ralph Corderoy
Hi Anton, > The trap is set by .it 1 an-trap, so I why is it > fired after the section text even is it was passed > to .SH as parameter? Are macro parameters handled > as input lines? No, I think you'll find it's this line, . if \\n[.$] \&\\$* that's placing any parameters as `input'.

Re: [Groff] Hanging paragraphs in MM

2010-06-03 Thread Anton Shepelev
> Ah, yes. In the manpage macros, this works similarly: all > paragraph macros reset the indent to what it "should" be > (so that any ".in" invocations within a paragraph will be > undone at the beginning of the next paragraph). That is, > ".TP" absolutely sets the indent to "something" + "extra"

Re: [Groff] Hanging paragraphs in MM

2010-06-02 Thread Tadziu Hoffmann
> Now I am prying into the implementation of the .TP macro > in MAN... Ah, yes. In the manpage macros, this works similarly: all paragraph macros reset the indent to what it "should" be (so that any ".in" invocations within a paragraph will be undone at the beginning of the next paragraph). Tha

Re: [Groff] Hanging paragraphs in MM

2010-06-02 Thread Anton Shepelev
Tadziu Hoffmann: > >> I can manage a two-part macro like .(MyPS and .)MyPS, >> so I could reset the indent upon exit. But I don't know how >> to do it using only one macro. I probably have to 'subscribe' >> to some 'call-back' macro that gets called every time a >> paragraph (in groff's

Re: [Groff] Hanging paragraphs in MM

2010-06-02 Thread Tadziu Hoffmann
> I can manage a two-part macro like .(MyPS and .)MyPS, > so I could reset the indent upon exit. But I don't know how > to do it using only one macro. I probably have to 'subscribe' > to some 'call-back' macro that gets called every time a > paragraph (in groff's sense) ends. Does groff o

Re: [Groff] Hanging paragraphs in MM

2010-06-02 Thread Anton Shepelev
Ralph Corderoy: > Hi Anton, > > > I can manage a two-part macro like .(MyPS and .)MyPS, so I could > > reset the indent upon exit. But I don't know how to do it using only > > one macro. I probably have to 'subscribe' to some 'call-back' macro > > that gets called every time a paragraph (

Re: [Groff] Hanging paragraphs in MM

2010-06-02 Thread Ralph Corderoy
Hi Anton, > I can manage a two-part macro like .(MyPS and .)MyPS, so I could > reset the indent upon exit. But I don't know how to do it using only > one macro. I probably have to 'subscribe' to some 'call-back' macro > that gets called every time a paragraph (in groff's sense) ends. Does

Re: [Groff] Hanging paragraphs in MM

2010-06-02 Thread Anton Shepelev
Mike Bianchi: > When I do need something special or "improved" then I make my own macro > and carry it around with me. I have my own MM macros that I > have carried around for decades, going back to my days at Bell Labs. I wonder, how do you 'deploy' your own MM macros? Just pick the ones y

Re: [Groff] Hanging paragraphs in MM

2010-06-01 Thread Mike Bianchi
On Tue, Jun 01, 2010 at 04:24:19PM +0400, Anton Shepelev wrote: > Mike Bianchi: > > > Anton, > > Could you just use \ to continue the macro onto your next line? > > > > .MyMacro FirstArg \ > > All the text that is processed by MyMacro FirstArg follows. > > Thanks for the hint. I tho

Re: [Groff] Hanging paragraphs in MM

2010-06-01 Thread Anton Shepelev
Me: > > I have made your code a bit simpler: > >.nr indnt 120 >.in +\n[indnt]u >.ti -(\n[indnt]u) >PS:\ Example of a post-scriptum, it has a hanging indent. >.in -\n[indnt]u I forgot to escape the \w request (first line). Here's the corrected verstion: .nr indnt \w'PS:

Re: [Groff] Hanging paragraphs in MM

2010-06-01 Thread Anton Shepelev
Mike Bianchi: > Anton, > Could you just use \ to continue the macro onto your next line? > > .MyMacro FirstArg \ > All the text that is processed by MyMacro FirstArg follows. Thanks for the hint. I thought about it and con- sidered it a sort of 'quick and dirty' (not en

Re: [Groff] Hanging paragraphs in MM

2010-06-01 Thread Anton Shepelev
Ted Harding: > One "hack" which might lead to what you want is to calculate an > indent based on the width of the tag "PS: ", and then increment > the line-indentation once the paragraph has been started (but > you would need to reset it at the end of the paragraph): > (Note the use of the unstret

Re: [Groff] Hanging paragraphs in MM

2010-06-01 Thread Mike Bianchi
On Tue, Jun 01, 2010 at 02:19:17PM +0400, Anton Shepelev wrote: > I often need to typeset single hanging paragraphs > like: > > PS: Example of a post-scriptum, it has a hanging > indent. > > I have created a macro for this, which > > 1. Calculates the length of the label and >

RE: [Groff] Hanging paragraphs in MM

2010-06-01 Thread Ted Harding
On 01-Jun-10 10:19:17, Anton Shepelev wrote: > Hello, all > > I often need to typeset single hanging paragraphs like: > > PS: Example of a post-scriptum, it has a hanging > indent. > > I have created a macro for this, which > > 1. Calculates the length of the label and > i