[comp.unix.questions] Question about UCB/Sun version of -ms macros

arnold@audiofax.com (Arnold Robbins) (10/16/90)

On a Sun 3/60, running SunOS 3.5, I want to use the -ms macros for
a document I'm working on.  I would dearly love to be able to produce
a table of contents, and indeed the ms(7) man page lists a .TC macro.
But I get no results from it.  It appears that the -ms macros are the
ones developed at UCB and not the original V7 macros.

The man page lists files in both /usr/lib/tmac and /usr/lib/ms.  Does
anyone know what the various pieces in the two directories are?

Does anyone know what sort of magic to use to get a table of contents
out of -ms?  Although I have enough troff knowledge to do it, my time is
better spent than deciphering the actual macros themselves.

(The -me macros aren't an option; -ms has a fighting chance of moving
to -mm one day, but -me doesn't.)

Thanks in Advance,
-- 
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

arnold@audiofax.com (Arnold Robbins) (10/19/90)

In article <269@audfax.audiofax.com> I wrote:
>On a Sun 3/60, running SunOS 3.5, I want to use the -ms macros for
>a document I'm working on.  I would dearly love to be able to produce
>a table of contents, and indeed the ms(7) man page lists a .TC macro.
>But I get no results from it.  It appears that the -ms macros are the
>ones developed at UCB and not the original V7 macros.

After some helpful email from the net, and some experimentation, I cobbled
up the following macro.  It is used *in place of* the .NH macro and the
following title in your text.  I.e., instead of

	.NH 2
	Second Level Heading Title

you type

	.HN 2 "Second Level Heading Title"

Use .TC at the end of your paper.  Here is the macro.  Share and enjoy:

	."
	." HN - Headings 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