groff
[Top][All Lists]
Advanced

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

Re: [Groff] Question re: Appending to a diversion (Another correction)


From: Clarke Echols
Subject: Re: [Groff] Question re: Appending to a diversion (Another correction)
Date: Sun, 18 Dec 2005 01:05:46 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

I am having "one of those days"...  Not only was I trying to use
`.de' instead of `.nr', but I got the `.da' and `.di' backwards.

Both corrections are shown in the code segment below, but the
behavior hasn't changed (changed lines have * in left column at
start of line instead of >).  The first footnote still seems to
be overwritten by the second.  What's going on?

Thanks,

Clarke

Clarke Echols wrote:

I am attempting to create a set of footnote macros for a book
I am typesetting for a friend.  I am including a segment from the
macro code to show how I am trying to create the diversion on each
page.

If footnote_flag is zero, that means no footnote has already
been defined on the current page.  If the flag is non-zero, the
footnote being diverted is not the first, and therefore must be
appended to the existing one or more footnotes, with a 0.5v
paragraph spacing between them.  After the diversion is complete,
footnote_flag is incremented to indicate that the first footnote
diversion on the current page has been created, so any subsequent
footnote diversions on the same page must be appended (the flag
is cleared when a new page is created (I haven't yet considered
what to do if a diversion must be split and the latter part placed
on a subsequent page)).

When I print a test file, if there is one footnote on the page,
the diversion prints that footnote, as expected.  However,
if the page has two footnotes, the first footnote is not printed,
and only the second gets printed by the footnote_print macro).
This leads me to think the first diversion is being overwritten
by the second, instead of the second being appended after the first.

I am completely new to this, and I have not been able to discover
what I am doing wrong, based on what the info file says about
the .di footnote_text, .da footnote_text, .di, and .da requests.
I am assuming that the diversion contains a collection of formatted
text strings, and the new diversion is simply collected and added to
the end of the existing diverted text.

I don't know if I am using the .sp .5v request correctly or not,
since I am unable to get two notes to print.

========
.
.
.   de footnote
.   ev 4                     \" Set up using environment 4
.   ps 9                     \" Point size
.   vs 10                    \" Line spacing
.   ll 4i                    \" Specify line length
.   in .1i                   \" Footnote paragraph indent
  .ie \\n[footnote_flag] \{  \" If footnote flag is set, not first note:
* .   sp .5v                   \" Space between footnotes  <<<< (moved)
.   ti -.1i                  \" Unindent for footnote number,
\\u\\f3\\$1\\f1\\d\\|\\c
* .   da foot_text             \" Append footnote number & text arg  <<<<<
\\$2                         \" Process footnote text string
.   br                       \" Break collected line.
* .   da \}                    \" End diversion append  <<<<<<<<
.el \{                     \" If footnote flag is not set, first note:
.   ti -.1i                  \" Unindent for footnote number
\\u\\f3\\$1\\f1\\d\\|\\c
* .   di foot_text             \" Start new diversion  <<<<<<<<
\\$2                         \" Process appended footnote text string
.   br                       \" Break collected line.
* .   di \}                    \" End diversion  <<<<<<<<
.
.ev                          \" Return to previous environment 0
.
.\" .de \\n[footnote_flag] +1   This is an error!   >>>>>>>>>>
  .
* .nr footnote_flag \\n[footnote_flag] +1    \" Corrected code <<<<<<<<
  .
.
.
======

Guidance from someone more knowledgeable than I is greatly
appreciated.

Merry Christmas and Happy Holidays to all!

Clarke


_______________________________________________
Groff mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/groff



_______________________________________________
Groff mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/groff





reply via email to

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