Xref: utzoo alt.sys.sun:1893 comp.unix.questions:26628 comp.unix.internals:918 Path: utzoo!utgpu!cs.utexas.edu!wuarchive!emory!audfax!arnold From: arnold@audiofax.com (Arnold Robbins) Newsgroups: alt.sys.sun,comp.unix.questions,comp.unix.internals Subject: Re: Printing section number with troff -ms macros. Keywords: troff, ms macros, string register Message-ID: <287@audfax.audiofax.com> Date: 31 Oct 90 17:46:02 GMT References: <1990Oct30.224252.7998@athena.mit.edu> Followup-To: alt.sys.sun Organization: AudioFAX Inc., Atlanta Lines: 25 In article <1990Oct30.224252.7998@athena.mit.edu> drk@athena.mit.edu (David R Kohr) writes: >I am trying to produce a Table of Contents which includes the section number >as well as page number for each item listed. I came up with this macro recently. It does all the work for you. Use this macro *instead of* the .NH and .XS/.XE macros, and put a .TC at the end. (It does answer your question, too; string register SN has the section number.) ." ." HN - Heading that are numbered and produce a Table of Contents entry ." ." Usage: .NH level "text" ." .de HN .NH \\$1 \\$2 .XS \\n(PN \\*(SN \\$2 .XE .. -- Arnold Robbins AudioFAX, Inc. | Laundry increases 2000 Powers Ferry Road, #200 / Marietta, GA. 30067 | exponentially in the INTERNET: arnold@audiofax.com Phone: +1 404 933 7612 | number of children. UUCP: emory!audfax!arnold Fax-box: +1 404 618 4581 | -- Miriam Robbins