groff
[Top][All Lists]
Advanced

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

[Groff] Problem with diversion


From: Robert D. Goulding
Subject: [Groff] Problem with diversion
Date: Fri, 25 Apr 2003 10:46:56 -0400 (EDT)

Well, a little playing around with simple documents showed that I was
misusing the .da request.  I've come up with a solution: each time a lemma
is added, append it to a string, then set the whole string in a (new)
diversion; result appended below (with a few egregious bugs fixed); and it
now works perfectly, although I haven't yet really investigated what
happens at page transitions.  This seems to me to be a bit of a hack - is
it the way expert groff hackers would do it?

By the way, what is the groff equivalent of TeXperts/TeXnicians -
grofficers?

R.

.nr ET 0-1i
.wh 0 top-of-page
.wh \n(ETu end-of-text
.
.de top-of-page
'sp 1i
.nr fn-flag 0
.nr lastsize 0
.rm footnote
.ds fn-string
.ch end-of-text \\n(ETu
.nr flushout 0+\\n(ET
..
.
.de end-of-text
.if \\n[fn-flag] \{\
.       ev fn-ev
.       footnote
.       br
.       ev
.\}
'bp
..
.ev fn-ev
.ps 8
.vs 10
.ll 5i
.po 1i
.ev
.
.de lemma
.if (\\n[fn-flag]=0) .nr fn-flag 1
.ie (\\n[lastline]=\\n(ln) .ds flabel
.el \{\
.       ds flabel \fB\\n(ln\fP\~
.       nr lastline \\n(ln
.\}
.ie !'\\$3'' \\$1\\$3
.el \\$1
.as fn-string \\*[flabel]\fI\\$1\/\fP]\~\\$2\h'2n'
.di footnote
.ev fn-ev
.br
\\*[fn-string]
.br
.ev
.di
.if (\\n(dn>\\n[lastsize]) \{\
.       nr flushout 0+\\n(ET-\\n(dn
.       tm flushout = \\n[flushout]
.       nr lastsize \\n(dn
.       ch end-of-text \\n[flushout]u
.\}
..
.
.ps 8
.ft I
.nm 1 2
.ft
.ps
.sp 1i
This is some
.lemma text "A: test"
and this is some
.lemma more "F: moron" .
Let's add some more text, which extends over several lines,
and
.lemma see "J: observe"
whether it all behaves as it should.
I hope this is going to
.lemma work "A: function"
correctly.
(etc.)

-- 
Robert Goulding
Society of Fellows
Joseph Henry House
Princeton NJ 08544


reply via email to

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