groff
[Top][All Lists]
Advanced

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

Re: [Groff] Hanging paragraphs in MM


From: Tadziu Hoffmann
Subject: Re: [Groff] Hanging paragraphs in MM
Date: Wed, 2 Jun 2010 18:19:11 +0200
User-agent: Mutt/1.5.17 (2007-11-01)

> 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 or MM have such
> a macro?

I don't think you can do it with just one macro if you don't
want to give the whole paragraph text as a macro argument.
(How is the code to know when the indent should be over?)
But, as you suggested, you can implicitly reset the indent
when a "normal" paragraph is started.  I don't think mm has
a hook for this, but you can "wrap" mm's paragraph macro with
additional code:


.\" mm
.\" ----------------------------------------------------------------
.nr tI 0
.\" ----------------------------------------------------------------
.\" tagged paragraph
.de tP
.oP
.nr tI \w'\\$1\ \ 'u
.in +\\n(tIu
.ti -\\n(tIu
\&\\$1\ \ \c
..
.\" ----------------------------------------------------------------
.\" end tagged paragraph & restore indent
.de eP
.if \\n(tI 'in -\\n(tIu
.nr tI 0
..
.\" ----------------------------------------------------------------
.\" redefine mm's paragraph
.rn P oP
.de P
.eP
.oP \\$@
..
.\" ----------------------------------------------------------------
.ll 5.6c
.H 1 "A Test"
.P
I often need to typeset single hanging paragraphs like:
.tP PS:
Example of a post-scriptum, it has a hanging indent.
.P
I have created a macro for this.





reply via email to

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