[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Footnotes/Endnotes formatting
- Subject: Re: Footnotes/Endnotes formatting
- From: Harry Binswanger hb@xxxxxxxx
- Date: Fri, 04 Jan 2008 15:02:26 -0500
Actually, I see that Paul is counting on not having the endnotes dumped at
the end yet. That makes it much easier! I may be missing something, but I
wouldn't isolate the XX by the and which will print out in the
end. Instead, use ≪NI≫, "note invisible" which doesn't print. So you'd have:
≪FN1≪NI≫Page 28≪NI≫ Binswanger, Harry The Biological Basis of
Teleological Concepts, p. 122.≫
That would simplify the loop I just sent you, but how do you get the
sequential footnote numbers out of there, if you do it this way? SF1 is
supposed to suppress the sequential numbers, but I can't get it to work.
The loop I sent assumes that the endnotes are already "dumped" to the
bottom of the file (which they are if you TYS them, but maybe you can't do
it that way). Surely there must be a better way>
Paul wrote:
In footnotes you could replace ≪PN≫ with XX and use the XPL
loop (by using the tags as beginning and ending field markers) to cut "XX"
and insert the current page number;
Just what I was thinking--i.e., put in each fn some unique string, e.g.,
QQQYY, then do a loop to finding each, replace it with the current page
number ≪VA$PG≫, then go on.
But actually, this is all unnecessary--we already have a unique string:
≪FN Why not use it?
To sustain re-running, each endnote has to typographically isolate the page
number you've inserted from the previous pass, so it can be deleted and
replaced by the updated page number. Fortunately, that is already the case:
the endnotes look like this:
≪MDFN≫28≪MDNM≫
So all you need do is replace everything *between* ≪MDFN≫ and ≪MDNM≫
with the correct page value (and any formatting you want--such as "p. 15"
but I'll omit that in the below. If it interests you, I can make it into
actual XPL for you.
≪sx10,0≫;*; initialize this s/g which stores the position in the file of
the next endnote
TF ;*; top of file, expanded mode, show page numbers
;*; start of loop
XP ;*; shift to expanded mode in order to be able to do search that folows
BX se /≪fn/Q2 ;*; find the start of footnote in text
≪if≪ER≫≪glb≫≪ei≫;*; exit if a footnote is not found (i.e., past the
last one)
SP ;*; shift to show page mode, necessary to get page number
≪sx01,≪VA$PG≫≫;*; store the page number of the fn
≪sx02,≪CP≫≫;*; store the cursor position for returning here on next loop
BX jmp ≪pv10≫Q2 ;*; jump to next end note (first time through loop, will
be top of file)
BX se /≪MDFN≫/Q2 ;*; find the beginning of the first/next endnote
DF ;*; start define
BX se/≪MDNM≫/Q2 ;*; find the end of the page number of that endnote
DF ;*; end define--page number (or, at first just the footnote number) now
defined
RD ;*; rubout defined text--i.e., delete the old/bad number
≪PV01≫;*; insert new number, and any formatting if you want--e.g., Page
≪PV01≫
≪SX10,≪CP≫≫;*; save the cursor position in the end notes, for next time
through
BX jmp ≪pv02≫Q2 ;*; jump back to where you were in body of file
≪gla≫;*; loop until done
≪lbb≫≪ex≫;*; done
Harry Binswanger
hb@xxxxxxxx