groff
[Top][All Lists]
Advanced

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

Re: [Groff] CORRECTION: Question re: Appending to a diversion


From: Clarke Echols
Subject: Re: [Groff] CORRECTION: Question re: Appending to a diversion
Date: Sat, 17 Dec 2005 23:44:11 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

There was a typo in the code segment (.de should have been .nr).
Correction is shown below.  Behavior is unchanged, so the question
still stands.

Sorry about the error.

CE

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 not set, first note:
.   ti -.1i                  \" Unindent for footnote number
\\u\\f3\\$1\\f1\\d\\|\\c
.   di foot_text             \" Divert footnote number & text argument
\\$2                         \" Process footnote text string
.   br                       \" Break incomplete line.
.   di \}                    \" End diversion
.el \{                     \" Else if footnote flag is set, not first:
.   sp .5v                   \" Space between footnotes
.   ti -.1i                  \" Unindent for footnote number
\\u\\f3\\$1\\f1\\d\\|\\c
.   da foot_text             \" Append footnote to existing diversion
\\$2                         \" Process appended footnote text string
.   br                       \" Break incomplete line.
.   da \}                    \" End appendage to 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





reply via email to

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