[comp.sources.wanted] Table of Contents in nroff

warren@pluto.UUCP (02/10/87)

I am looking for ways to create a table of contents in nroff
documents, and would also like to be able to tag sections so
I could say "See section <foo>" and foo's number would appear
in my output.  I would like to use -ms macros since much
has been written using them.

I noticed, in my /usr/lib/ms directory, a file called s.toc.
It seems to redefine the NH macro and will dump a table of
contents at the end of your document.  There is no doc, anyone
tried it?  It doesn't solve the other problem, as far as I can
tell, and I like TOC's in front of the document, not at the
end (or I'm guaranteed to forget to move it the time the
document goes to be copied and bound)

Before I noticed this file, I had kluged as follows - rewrote
the NH macro so it placed _TITLE_ <page_number> in front of
each title (underlined, of course), then sent the output through
a bunch of filters to remove the junk from each line, produce
a list of titles, feed it through nroff again to paginate and
include titles, and splice it into the document after 66 lines.
THe document has to be in .RP format so there is a cover page
to stick the TOC after.

It works, and you can have a copy by asking, but it's klugey and
I have to pass my shell script the line width and document title,
and this also doesn't solve the second problem.

Anyone have any ideas?
Thanks
-- 
/|/~\~~\
 |__/__/_/
 |
/

warren@pluto.UUCP (03/02/87)

I posted this some time ago.  I since discovered that old maps were
routing my mail through phri and pyrnj to which we were not connected.  If
you replied and it bounced, please try again as we are now linked.  And
thanks to all who have replied.

Two people mentioned the lbl package.  Was this posted to a source
group a while ago?

< I am looking for ways to create a table of contents in nroff
< documents, and would also like to be able to tag sections so
< I could say "See section <foo>" and foo's number would appear
< in my output.  I would like to use -ms macros since much
< has been written using them.
< 
< I noticed, in my /usr/lib/ms directory, a file called s.toc.
< It seems to redefine the NH macro and will dump a table of
< contents at the end of your document.  There is no doc, anyone
< tried it?  It doesn't solve the other problem, as far as I can
< tell, and I like TOC's in front of the document, not at the
< end (or I'm guaranteed to forget to move it the time the
< document goes to be copied and bound)
< 
< Before I noticed this file, I had kluged as follows - rewrote
< the NH macro so it placed _TITLE_ <page_number> in front of
< each title (underlined, of course), then sent the output through
< a bunch of filters to remove the junk from each line, produce
< a list of titles, feed it through nroff again to paginate and
< include titles, and splice it into the document after 66 lines.
< The document has to be in .RP format so there is a cover page
< to stick the TOC after.
< 
< It works, and you can have a copy by asking, but it's klugey and
< I have to pass my shell script the line width and document title,
< and this also doesn't solve the second problem.
< 
< Anyone have any ideas?
-- 
/|/~\~~\
 |__/__/_/
 |
/