groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Mildly useful macros for tables of contents


From: James J. Ramsey
Subject: [Groff] Mildly useful macros for tables of contents
Date: Thu, 6 Feb 2003 08:58:40 -0800 (PST)

I don't claim that these macros are great art, but I
thought they might be handy in case the "index" macros
of -me, -ms, or -mm aren't sufficient for some reason.
All they are supposed to be is a framework. To
actually use them to make a table of contents, one is
supposed to define the macros TocPre, TocPost, and
TocEntry.

They do have their good points, though:

1) They should be generic enough to be useable by any
of the macro packages. They don't even contain \n% in
them, since some macro packages, like -ms, use their
own registers or strings to display the page number.
(It's also possible to do things like have page
numbers like A-1 in the TOC.)  Any macro code that
needs to be specific to a macro package can be put in
TocPre, TocPost, and TocEntry. 

2) Enough is left undefined so that the table of
contents can be defined to look like just about
anything. There are no assumptions that the TOC will
use leaders, indentation, or even that there will be
one entry to a line.

3) Each entry on stderr begins with ".TocEntry". That
should make it easy to filter out the lines pertaining
to the TOC from index entries, lists of tables or
figures, or actual error messages.

4) The table of contents can actually be placed where
it will appear in the final document, instead of just
at the end.

The not-so-good:

One still has to define the macros TocPre, TocPost,
and TocEntry, which may involve things like messing
with tab stops, setting and unsetting no-fill mode,
etc. It probably would help to have samples of
possible definitions of TocPre, TocPost, and TocEntry
that a user could learn from and modify.

Hope someone finds these macros useful.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Attachment: tocmacros.t
Description: tocmacros.t


reply via email to

[Prev in Thread] Current Thread [Next in Thread]