groff
[Top][All Lists]
Advanced

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

Re: [Groff] problem with nested diversions


From: Tadziu Hoffmann
Subject: Re: [Groff] problem with nested diversions
Date: Mon, 18 Aug 2008 15:07:55 +0200
User-agent: Mutt/1.5.16 (2007-06-09)

It appears you're processing your footnote contents twice, which
(in my opinion) is usually a bad idea.  I think one should
either record the footnote in a diversion with already the
final formatting in place (font size, line spacing etc.)[*] and
then just replay that diversion without further processing[**]
(aside from re-diverting to capture overflows), or, in case the
material *must* be formatted at a later point (e.g., to process
references like "this footnote is on page n", where the output
page may be different from the current page when the footnote
was collected -- a useful trick also for floating figures), to
store the material unformatted.  (To capture unformatted text,
use "de" instead of "di".)

[*] Notice how your ".ps 8" didn't work? That's because the
footnote text was already formatted at 11 points when the
footnote was read *as part of diversion "a"*.

[**] That's why I find Werner's solution a bit ugly, because
it has to unformat processed text.

Your suggestion of using separate diversions for the footnotes
is probably the best for what you're attempting.  Below is an
example saving the footnotes unformatted in separate macros and
replacing the footnote call by a (self-replicating) reference in
the running text which then formats the individual footnotes into
diversion "fnote" when the main diversion "a" is finally output.
(The procedure could probably be simplified, but at least it's
highly configurable.)

(By the way, I'm not sure why you don't attach the footnote
marker to the running text immediately.  The footnote marker
won't change, will it?)

.\"
.\" ----------------------------------------------------------------
.de fn((
.ds fnid \\$1
\s-2\u\\$1\d\s0
\!.fnref \\*[fnid]
.de fn\\*[fnid] fn))
.ev note
.ft R
.ps 8
.vs 10p
.ll 20P
.da fnote
\\$1.
..
.de fn))
.am fn\\*[fnid]
.br
.di
.ev
\\..
..
.de fnref
.ie !'\\n[.z]'' \!fnref \\$1
.el \{.fn\\$1
.rm fn\\$1\}
..
.\" ----------------------------------------------------------------
.sp 1i
.po 1i
.ps 11
.vs 13p
.ll 20P
.\" ----------------------------------------------------------------
.di a
Even without publication, Nightingale's \fISuggestions for
Thought\fP attracted much scholarly attention. Several editions
of excerpts have been published. Three books of excerpts, and a
separate edition of ``Cassandra,'' were published later in the
twentieth century.\c
.fn(( 1
Michael D. Calabria and Janet A. Macrae, eds.,
\fISuggestions for Thought by Florence Nightingale\fP.
.fn))
As usual the official biography, E.T. Cook's \fIThe Life of
Florence Nightingale\fP, can be counted on for excellent
background on the purpose and writing.\c
.fn(( 2
Another footnote on page \\n%.
.fn))
.br
.di
.nf
.a
.sp
.fnote
.rm fnote
.\" ----------------------------------------------------------------




reply via email to

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