H [0+8+FQ(+4)[1 0FO10F"G+Q1' +FQ()+4U1 FQ1"L0' ,Q1:M(Q1+4(]1]0)) O|s&!&C) Y)om++B(*NVX4qj36> 7f1HGMJTgT;B;)Sl\2gf2mYU& Renumber Text& Setup RENUM LibraryRenumber AllRenumber Complement Draft ModeRenumber EquationsRenumber FiguresRenumber ReferencesRenumber SectionsRenumber Tables~DIRECTORY~~DOC~ & Renumber Text~DOC~ & Setup RENUM Library~DOC~ Renumber All~DOC~ Renumber Complement Draft Mode~DOC~ Renumber Equations~DOC~ Renumber Figures~DOC~ Renumber References~DOC~ Renumber Sections~DOC~ Renumber Tables~DOC~ ~Filename~~Filename~~INVERT~9:i*TEXM.VRenumber Text Formatter ff-1"e fuRenumber Text Formatter '"# ' M.CRenumber Draft Mode1=>in draft mode M.CRenumber Whole File1=>ignore narrowing M.CRenumber Section SeparatorsText separating indexing levels M.CRenumber Section Default SeparatorIn case user forgets one at the end of his new section number. M.CRenumber New SectionText for identifying new section--case is significant. Start with a if you require it to start on a new line. M.CRenumber New ChapterText for identifying new chapter--case is NOT significant. Start with a if you require it to start on a new line. M.CRenumber WhitespaceText preceding first significant character of a figure or table or second pass equation. M.CReference Output FilenameBibliography table is stored here when Renumber References is given an arg of 1 M.CReference DashText for replacing consecutive numbers (references). Used by Reference Sort Macro. M.CReference Bibliography BeginText denoting start of bibliography. M.CReference Bibliography EndText on the 1st line after the last reference in the bibliography. Should probably start with . M.CReference Bibliography SeparatorText between references in the bibliography. The exact point records are broken up is at the beginning of the line that a search for this text would leave the pointer. M.CReference Auto TextText preceding filename to yank references from. Must be on the same line as the last character of the text in q$Reference Bibliography Begin$ M.CRenumber References Default OptionsOptions to use if not specified in file M.CSection Search Pass 1Contains macro to move pointer to the start of a section to renumber on 1st pass M.CSection Search Pass 2Contains macro to move pointer to the start of a section to renumber on 2nd pass M.CSection Renumber Pass 11=>actually do renumbering on the 1st pass M.CEquation Search Pass 1Contains macro to move pointer to the start of a equation to renumber on 1st pass M.CEquation Search Pass 2Contains macro to move pointer to the start of a equation to renumber on 2nd pass M.CEquation Renumber Pass 11=>actually do renumbering on the 1st pass M.CFigure Search Pass 1Contains macro to move pointer to the start of a figure to renumber on 1st pass M.CFigure Search Pass 2Contains macro to move pointer to the start of a figure to renumber on 2nd pass M.CFigure Renumber Pass 11=>actually do renumbering on the 1st pass M.CTable Search Pass 1Contains macro to move pointer to the start of a table to renumber on 1st pass M.CTable Search Pass 2Contains macro to move pointer to the start of a table to renumber on 2nd pass M.CTable Renumber Pass 11=>actually do renumbering on the 1st pass M.CReference Search MacroSearch macro for next reference M.CReference Sort MacroSort macro to run when finished renumbering a group of references. This macro is run by Reference Search Macro by doing m0 M.CReference Bibliography Sort MacroSort to do on bibliography. 0M.VRenumber Draft Mode 1M.VRenumber Whole File :i*.-M.VRenumber Section Separators :i*.M.VRenumber Section Default Separator m(m.mRenumber Complement Draft Mode) :@i*/ qs+1"n 0 ' fqn"eqnuo0' qd"e :io 0 ' fqo"e qnuo 0,fqn-1:gnut quj-1 ' 0[10[2 qRenumber Section Separators[3 qb[..o hk gn j hkgo j q1-q2+2u2 -q2f"l:s3"ej'"#c'' .u2 \+1u1 q2jk :g1u1 g1 hxt i.hxo ]..o ]3]2]1 quj-1 /M.VSection Search Pass 1 1M.VSection Renumber Pass 1 :@i*/ 1f[bothcase !srchsect! :ssection"e' s   r3:fb"e osrchsect ' fkc 1:fb* -1 /M.VSection Search Pass 2 :i*  --M.VRenumber Whitespace :@i*/ qRenumber Whitespace[1 qs+1"n8:fb"l ogetnum ' ' !tryagain! :sfFig.fFigurefFigs."l 5:fb"eotryagain' !getnum! . -s1fkc :-.-3"gotryagain' '  /M.VFigure Search Pass 1 1M.VFigure Renumber Pass 1 :@i*/ qRenumber Whitespace[1 qs+1"n8:fb"l ogetnum ' ' !tryagain! :sfFig.fFigurefFigs."l qRenumber Draft Mode"e fkcdfkrr ' 5:fb"eotryagain' !getnum! . -s1fkc :-.-3"gotryagain' '  /M.VFigure Search Pass 2 :@i*/ qRenumber Whitespace[1 qs+1"n8:fb"l ogetnum ' ' !tryagain! :sfTable"l 5:fb"eotryagain' !getnum! . -s1fkc :-.-3"gotryagain' '  /M.VTable Search Pass 1 1M.VTable Renumber Pass 1 :@i*/ qRenumber Whitespace[1 qs+1"n8:fb"l ogetnum ' ' !tryagain! :sfTable"l qRenumber Draft Mode"e fkcdfkrr ' 5:fb"eotryagain' !getnum! . -s1fkc :-.-3"gotryagain' '  /M.VTable Search Pass 2 0M.VRenumber References Default Options :i*REF TABLEM.VReference Output Filename :@i*/ [t qs+1"eofindnxt' .,.+1:fb]"l .-1ut -s[c.us qs-qt"eofindnxt' 1a"aofindnxt' .,qt:fb,"l m0 ' fqn"eofindnxt' qsj s]r f[vz b,.fsboundaries qsj !inschap! gn .,z:fb,"l sr oinschap ' f]vz ofindnxt ' .,.+1:fb,"l sr.us !findend! s,]r  ' !findnxt! :s [ ["l 1a"a .us f[vbwf[vz s]r qs,.fsboundaries j j f]vzwf]vb ofindend ' ofindnxt '  /M.VReference Search Macro :@i*/ [s[t[u[v f[vbwf[vz qs,qtfsboundaries ji zji, s$r\s,$ js b,.-1kzjrd j !newstart! s r\us .ut 0uu !nxtnum! :s,"l sr \-qs-%u"g qu-2"g qt,qvkgReference Dash s, onewstart '"# -s, onewstart ' '"# -sc .uv onxtnum ' ' %u-2"g qt,qvkgReference Dash ' f]vzwf]vb  /M.VReference Sort Macro :@i*/ [s[t[u qReference Bibliography Beginus qReference Bibliography Endut qReference Bibliography Separatoruu -ssfkcwsu 0l .us :st"e!"!FTt missing. Can't preform sort. ' 0l f[vbwf[vz qs,.fsboundaries qo&4"e s[n$ \:su$"l0l'"#zj' '"# s[$s]$r :su$"l0l'"#zj' ' j qo&4"e s[n]0l '"# s[]0l ' b,.k j0us qo&4"n qs+2-qcf"g ftIncomplete deletion. Do :BUG RENUM and give filename. '"l ftYou are missing qc-qs-2:=ft references. Subtract 4 from option and retry to list which are missing.  '  ' qc-1-qs"n ftMissing qc-1-qs:=ft references at the end of the bibliography.  '  /M.VReference Bibliography Sort Macro f~Renumber Text Formattertex"e :i*% Section M.VRenumber New Section :@i*/:s\eqno((/M.VEquation Search Pass 1 1M.VEquation Renumber Pass 1 :@i*/ qRenumber Whitespace[1 [s !loop!:s("l .us 3:fb"e oloop' -s1fkcc .-qs"nqsjoloop' 1a"d' 1a"a' oloop '  /M.VEquation Search Pass 2 :i*--M.VReference Dash :i* \referencesM.VReference Bibliography Begin :i* \vfillM.VReference Bibliography End :i* \M.VReference Bibliography Separator :i*from file M.VReference Auto Text :i* % ChapterM.VRenumber New Chapter ' 0@fo..QRENUM Setup Hookf"n[1m1w]1' fsosteco"e [1[2 FSXUNAME:F6u1 FSUNAME:F6u2 f~1sk"n 0[..f e[e\ fne^e] f[dfile [buffer filenames f[bbind iFROM-PROGRAM:Emacs Renumber FROM-XUNAME:1 FROM-UNAME:2 RCPT:(SK MC) SUBJECT:Automatic Renumber Usage Report TEXT;-1 I used your Renumber Package.  ew.MAIL.;eeMAIL > ' '  qRenumber Whole File"g f[vbwf[vz 0,fszfsboundaries z,z-1000:fbLocal Modes:"l 0,.fsboundaries ' ' [a[c1[d[e[n[o[s[t[u[z 0[..F [..D 0f[serror 0f[bothcase f[vz j240,32i50,65i350,32i j.,.+640fx..d :in :io 5fsqvectoruz 3u:z(0) !nxtsection! 1uc .us :s0"l s r b,.fsboundaries qsj ' :gcut :i*ntut -1us zj fsvzus f]vz fsvz-qs"l f[vz 1a-42"e c qRenumber Draft Mode-1"e 1ue '"# 0ue ' '"#1ue' .uu 1a"ac0ud'"#1ud' fb fkc [d qRenumber Section Separators[1 1:fb1"l0ud' ]1 qu,.xn qd*fqn"g qRenumber Section Default Separator[2 :inn2 ]2 ' ]d onxtsection ' fqz-5"ejw' j f[vz !nxt2section! .us :s0"l s r b,.fsboundaries qsj ' -1us zj fsvzus f]vz fsvz-qs"l f[vz 1a-42"e c qRenumber Draft Mode-1"e 1ue '"# 0ue ' '"#1ue' .uu 1a"ac0ud'"#1ud' fb fkc [d qRenumber Section Separators[1 1:fb1"l0ud' ]1 qu,.xn qd*fqn"g qRenumber Section Default Separator[2 :inn2 ]2 ' ]d onxt2section ' jm(m.mRenumber Sections) m(m.mRenumber Equations) m(m.mRenumber Figures) m(m.mRenumber Tables) m(m.mRenumber References)qRenumber Text Formatter[1 qRenumber Draft Mode-1uRenumber Draft Mode qRenumber Draft Mode"e QBuffer Filenames"Eotypemode' FSModified"N @FT Save your source changes before RENUM processing 1m(m.m& Yes or No)"n 1m(m.m^R Save File)'' etFOO > 0uBuffer Filenames 0u:.b(qBuffer Index+2) m(m.m& Set Mode Line) !typemode! @ft FINAL PRINT MODE (1) '"# @ft DRAFT MODE (1) ' 0fsechoactive [b[0[1[2[3[4 fsbconsub qRenumber New Section@fo..QRenumber Section New Sectionu0 qSection Search Pass 1u1 qSection Renumber Pass 1u3 qSection Search Pass 2u4 m(m.m& Renumber Text) qbfsbkill [0[1[2[3[4 qRenumber New Section@fo..QRenumber Equation New Sectionu0 qEquation Search Pass 1u1 qEquation Renumber Pass 1u3 qEquation Search Pass 2u4 m(m.m& Renumber Text) [0[1[2[3[4 qRenumber New Section@fo..QRenumber Figure New Sectionu0 qFigure Search Pass 1u1 qFigure Renumber Pass 1u3 qFigure Search Pass 2u4 m(m.m& Renumber Text) [0[1[2[3[4 qRenumber New Section@fo..QRenumber Table New Sectionu0 qTable Search Pass 1u1 qTable Renumber Pass 1u3 qTable Search Pass 2u4 m(m.m& Renumber Text) oqRenumber Draft Mode"g  ' QBuffer Filenames"n etFOO > 0uBuffer Filenames 0u:.b(qBuffer Index+2) m(m.m& Set Mode Line) ' qRenumber Whole File"g f[vbwf[vz 0,fszfsboundaries ' [0[1[z[c[n[o0[p[r[s[t[a 0[..F 0f[serror 1f[^pcase f[vbwf[vz qReference Sort Macrou0 qReference Search Macrou1 :in -1"e fsbconsur ' j1000:fbRenumber References Options"l s r\uo '"# qRenumber References Default Optionsuo ' j !nxtchapter! 5fsqvectoruz 3u:z(0) 1uc .us qRenumber New Chapterut :st"l s r qs,.fsboundaries ' zj qReference Bibliography Beginus -:ss"lfkcl' f[vz b,.fsboundaries :gcut !secpass! -1us j qo&1"nqp"efqz-5"g %p 1uc fqz/5-1us 1ut qo&2"eosecpass' ''' fsvzus f]vz fsvz-qs"e onobiblio ' f[vz qsfsvz zj-l qReference Auto Textus :fbs"l s r .us :l qs,.fxs e[ f[dfile ers@a f]dfile e] ' f]vz -1us mReference Bibliography Sort Macro !nobiblio! -1"efqz-5"g qr[..o z,zfsboundaries fqz/5-1us 1ut qo&1"e hxt s $r\l ' ji ****************** Chapter n ****************  Numerical list of references  qo&1"e zji Alphabetic list of references gt ' zji  ]..o '' zj fsvzus f]vz fsvz-qs"l f[vz .us fb   qs,.+fkxn onxtchapter ' -1"e e\ fne^ f[dfile [buffer filenames qr[..o 0,fszfsboundaries qReference Output Filenameu1 ewee1 FSBKill ' 0,zfsboundaries jRENUMLibrary for renumbering references, sections, equations, figures, and tablesS Sets up default variables for & Renumber Text and Renumber References. If arg, load into qRenumber Text Formatter. This is useful if you load the RENUM library in your init. If no arg, try to determine the type of formatter used and load into qRenumber Text Formatter. TEX is assumed otherwise. Then load the default variables depending on the formatter used and run qRENUM Setup Hook (if exists) for any user customization. S Routine used to renumber sections, equations, figures, and tables. The Renumber Text routine is a two-pass routine. On the first pass, all the defined equation numbers and the new numbers are stored in a table. On the second pass, any equation references are looked up and given the corresponding number in the table. If Renumber Pass 1 is 1, renumbering is also done on the first pass.C Runs the Renumber routines for references, sections, equations, figures and tables. For details, see the RENUM node in the INFO program. Runs: Renumber Sections Renumber Equations Renumber Figures Renumber Tables Renumber References Any argument is passed to Renumber References (1 means write REF TABLE file). C Toggles the value of qRenumber Draft Mode You will always win in draft mode and can run the all the macros to your heart's content. The draft mode is used to renumber the working manuscript---bibliographic renumbering is not done, implicit section numbering will not be processed, and text signifying forward referencing is preserved. The final mode can be used before printing the final paper or before printing each draft. The file should be deleted after running through the text formatter as forward referencing is lost, bibliographic referencing becomes next to impossible, and you will no longer be able to move things without loss of information if you have used implicit numbering. You are initially in draft mode (qRenumber Draft Mode is 1). For more info, see the DRAFT node of the RENUM node in the INFO program. C Renumbers sections in order of definition and references to a section. First pass scan: "% Section " (case is significant) Second pass: "section" (case is ignored) Examples: \majorsection 2.3 Overview % Section 2.3 ... we saw in section 1.2 that ... In the first example, the 2.3 before the "Overview" gets numbered on the 2nd pass. The result is that the two numerical values on this line always coincide, no matter where in the file this section is moved to. All numbers referring to a section (NOT an equation, etc. WITHIN a section) must be typed completely (no implicit mode). Sections are renumbered with attention paid to . and - (q$Renumber Section Separators$) conservation. In other words, it renumbers things the way you would by hand. Specifically, it counts the number of index separators (. or -) in the next section and the section just renumbered (an index separator is always assumed at the end of a number even if not explicitly typed). If they are the same, then the last index of the previous number is bumped. If the new section contains more dots, a ".1" is suffixed to the previous number. If the new number contains less dots, the macro moves back that many more indices, bumps the number that is there, and clears the line while preserving the default separator the user specified. Examples: Old Sequence Renumbered Sequence --------------- --------------------- 1.2- 1.2- 3.5 1.3 6-2.1 1.3.1 3. 2. 5- 3- 5.5 3-1 If you wish to have a particular section number accepted at face value, just precede it by a null section number. This is useful if you like to skip from say 2.6 to 3.1 instead of to 3. Section numbers beginning with an alphabetic character will not be re-lettered. After the first character, two non-digits signal the end of the section name (number) as usual. If a numbered section appears after a lettered section, it will not get renumbered. This is because sections are renumbered based on the last section and if the last section was alphabetic, there are no guidelines. This tends to be a useful feature if you have sections missing and want your sections renumbered as you specify. Simply insert a % Section will a null section number before the % Section statement which you want accepted as is. If you don't have a dot or a dash after the last digit in section definition line, a dot (q$Renumber Section Default Separator$) is used for separation when you run the renumber macros for equations, figures, and tables. To refer to something in another section, you must specify that section exactly: 1.2-1 is NOT the same as 1.2.1. Of course, text after the last digit is ignored so 1.2.1xx can refer to % Section 1.2.1-. SUBTLE POINT: If you are a real hacker, you will wonder how renumbering can be done on pass 1 since the scan rules of the second pass are a subset of the scan rules of the first pass. The reason is that when the file is processed section by section, it is broken off after the word "Section" in the "% Section" statement. Hence, during the second pass, the "Section" at the end of the current boundaries doesn't meet the scan rules since there are no digits after the word "section"--there is nothing For details, see the RENUM node in the INFO program.C Renumbers equations in order of definition. First pass scan: "\eqno(" or "(" (case is significant) (The "(" is provided for people who use \eqalignno). Second pass scan: "(" with a digit within the next 3 characters. The ( must be preceded by a , or -- (which is the contents of qRenumber Whitespace) and immediately followed by a letter or a digit. For a little bit more info, do MM DescribeRenumber Figures For gory details, see the RENUM node in the INFO program. C Renumbers figures in order of definition. How a "figure" to be renumbered is recognized. First pass scan: Examples are: xxxFig. A-3 fooFigs. 3, and 4 Figures 3--4 \Figure 3, 3.4-4, or C.4-5 Second pass scan: Is same as the first pass scan only a lowercase f must precede the capital F. The lower case f is deleted in final print mode. On both passes, case is significant. Detailed description of first pass scan (the second pass scan is analogous): If a digit is within 8 characters of the end of the significant portion of the last figure renumbered, go GET-DIGIT. Otherwise, search for anything but "f" preceding "Fig." or "Figs." or "Figure" and search the next 5 characters for a digit. GET-DIGIT: move back to after a delimiter (q$Renumber Whitespace$ which is initially and --). The pointer is now at the start of something to be renumbered. The end is considered to be just before two consectutive non-digits. This text is looked up in a table and the appropriate things done on the first or second pass: on the first pass, the text is added to the table if not already there; on the second pass, if a lookup fails, that particular text is left unchanged, the user is notified, and the scan proceeds normally. If the text looked up contains only digits, implicit input is assumed and the current section number is tacked on before doing the lookup. The current section number is determined by the text after "% Section " (qRenumber New Section) or the text in qRenumber Equation New Section if this variable exists (this is true for the figures, tables, and sections renumber macros if you use Figure, Table, Section respectively in place of Equation). On output, if the section number of the renumbered text is the same as the current section number, the section number is stripped only if 1) you are in final print mode 2) an asterisk precedes the current section number in the section definition line. If you don't have a dot or a dash after the last digit in section definition line, a dot (q$Renumber Section Default Separator$) is used for separation when you run the renumber macros for equations, figures, and tables. For more details, see the RENUM node in the INFO program.C Renumbers tables in order of definition. See documentation for Renumber Figures. Scan rules allow Tables, Table, and the "f" variants of these. {C Renumbers references in order of definition. Only works in final print mode (do MM DescribeRenumber Complement Draft Mode). Quick summary (detailed description follows): --------------------------------- References: [foo68a, bar80a] are examples. Bibliography start: \references Auto Referencing: "from file " appearing on the same line as the Bibliography start. In TEX, you will need a % before this text so it isn't printed. Bibliography entry: \ [] Bibliography End: \vfill Chapter sectioning: % Chapter Statistics file: use 1 MM Renumber All or 1 MM Renumber References. Options text: "Renumber References Options " must appear in the first 1000 characters to over-ride default. Options bits: +1 => Alphabetic instead of order of appearance +2 => Don't replace any text before bibliography +4 => Don't replace any text after bibliography Default setting is 0. For more details, see the RENUM node in the INFO program.& Setup RENUM Library & Renumber Text Renumber All Renumber Complement Draft Mode Renumber Sections Renumber Equations Renumber Figures Renumber Tables Renumber References +8+fq(+4)[20[3 <%3,-q2f2u3q3&1@;q3"l0'> f[BBindq3-1*5,q3*5g2q:..o(0)+q2