crc@abic.UUCP (Clive Charlwood) (06/10/86)
Dear People, Is it possible to referencce other sections using the MM macros (or any other macros). Referencing previous sections seems fairly simple (save present section number). Forward seem more difficult. I believe that [nt]roff only makes one pass. Sorry I sent this to net.unix, I couldn't find a reasonable newsgroup. Thanks in advance Clive -- Clive R. Charlwood @ Allen-Bradley Company Industrial Computer Division 747 Alpha Drive, Highland Heights, OH 44143 ...!{decvax,masscomp,pyramid,cwruecmp}!abic!crc
campbell@maynard.UUCP (Larry Campbell) (06/10/86)
In article <808@abic.UUCP> crc@abic.UUCP (Clive Charlwood) writes: > > Is it possible to referencce other sections using the MM macros >(or any other macros). Referencing previous sections seems fairly >simple (save present section number). Forward seem more difficult. >I believe that [nt]roff only makes one pass. >-- > Clive R. Charlwood @ Allen-Bradley Company > Industrial Computer Division > 747 Alpha Drive, Highland Heights, OH 44143 > ...!{decvax,masscomp,pyramid,cwruecmp}!abic!crc About a year ago a program called 'lbl' was posted to net.sources that does exactly what you want. It operates as a preprocessor, a la 'tbl' and 'eqn', and handles not only references but also header/page/figure label computation, multiple header formats, mixed alpha/numeric labels, and so forth. I've used it heavily for ten months, and about the only drawback I've found is the inherent one -- since it's a preprocessor, you can't really put lbl commands inside [nt]roff conditionals. (Well, you CAN, but the result probably isn't what you were hoping for.) Lbl compiled and ran on my tiny VENIX system the first time, and in ten months I haven't encountered a single bug. This is high praise indeed. I can mail lbl to people if there's interest. If I get more than two or three requests, I'll post it to mod.sources instead. Here's the 'Introduction' file that came with the software: -------------------------------- This is a distribution of a preprocessor, lbl, for nroff and its kindred. Lbl allows you to give symbolic labels to objects in a text file which belong in numbered sequences (e.g. chapters, figures, tables, equations) and to refer to them by name; sequence numbers are assigned automatically. Hence, it is unnecessary to adjust all cross-references every time that a new item is inserted into the middle of a sequence. Multi-level sequences are supported (similar to the multi-level section numbers in many macro packages); the user has control over the format of each level of sequence numbers (roman, arabic, letters). Many independent sequences may be used simultaneously, limited only by the memory available to the program; the same name may be used for items in several sequences. The program was written by Chris Miller at Heriot-Watt University, Edinburgh. Please report bugs, portability problems or ideas for improvements to chris@hwcs.uucp ( ....!mcvax!ukc!kcl-cs!hwcs!chris if you need to be more explicit in your mail path). As indicated in the attached NOTICE, you are free to pass this to anyone else; it contains NO code restricted under proprietary agreements. If you make alterations, please (a) inform the author and (b) mark the emendations to the original distribution clearly (preferably through conditional compilation) -- I desire neither praise for your brilliance nor scorn for your incompetence! -------------------------------- -- Larry Campbell The Boston Software Works, Inc. ARPA: campbell%maynard.uucp@harvard.ARPA 120 Fulton Street, Boston MA 02109 UUCP: {alliant,wjh12}!maynard!campbell (617) 367-6846