[Top][All Lists]
[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: |
Thu, 24 Apr 2003 21:32:11 -0400 (EDT) |
I'm trying to put together a set of macros for making a critical edition.
One thing I want is a special kind of footnote, called `paragraph-style'
in various LaTeX packages. There is no footnote marker in the text;
instead, the footnote is referred to by its line number in the text. The
footnotes appear one after another, without line breaks. If you compile
the file below, you'll get a clear idea of what I'm trying to do.
Now, in the code I'm attaching, the footnotes (or `lemmas') are set in a
diversion. What should happen is this: when the size of the footnote
block grows, because a lemma has run onto a second line, the end-of-text
trap should be moved upwards. This is not working, because \n(dn always
remains at the same value: 10000 units (i.e., one line of text). This is
the first time I've tried to do anything clever with diversions and traps,
and, to be honest, I don't quite understand what I'm doing here with
breaks, environments etc. Can anyone tell me *why* groff thinks that the
footnote diversion is always just one line long? I've tried moving the
environment switch inside and outside the diversion, as well the .br's,
but to no effect.
Sorry about the length of the posting - I wanted to get 2 or 3 lines of
lemmas, so you could see that \n(dn was not growing as I would expect it
to.
Thanks, Robert.
.wh 0 top-of-page
.wh -1i end-of-text
.
.de top-of-page
'sp 1i
.nr fn-flag 0
.nr lastsize 0
.rm footnote
.ch end-of-text -1i
.nr ET 0-1i
..
.
.de end-of-text
.if \\n[fn-flag] \{\
. ev fn-ev
. footnote
. br
. ev
.\}
'bp
..
.ev fn-ev
.ps 8
.vs 10
.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
.da footnote
.ev fn-ev
.br
\\*[flabel]\fI\\$1\/\fP]\~\\$2\h'2n'
.br
.ev
.di
.tm Size of footnote diversion: \\n(dn
.if (\\n(dn>\\n[lastsize]) \{\
.tm !!!!!!!!!!!!! MOVING TRAP !!!!!!!!!!!!!!
. nr ET \\n(ET-\\n(dn
. tm ET = \\n(ET
. nr lastsize \\n(dn
. ch end-of-text \\n(ETu
. ptr
.\}
..
.
.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.
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.
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.
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.
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.
- [Groff] Problem with diversion,
Robert D. Goulding <=
- [Groff] Problem with diversion, Robert D. Goulding, 2003/04/25
- Re: [Groff] Problem with diversion, Ralph Corderoy, 2003/04/25
- Re: [Groff] Problem with diversion, Werner LEMBERG, 2003/04/25
- Re: [Groff] Problem with diversion, Alejandro Lopez-Valencia, 2003/04/25
- Re: [Groff] Problem with diversion, Ralph Corderoy, 2003/04/25
- Re: [Groff] Problem with diversion, Alejandro Lopez-Valencia, 2003/04/25
- Re: [Groff] Problem with diversion, Werner LEMBERG, 2003/04/26