[l2h] L2H Wish list entry - Short Contents

Michael L. Hall Michael L. Hall" <hall@galt.lanl.gov
Thu, 1 Apr 1999 17:14:15 -0700


An entry for the L2H Wish List:   Short Contents

I'm doing a long document which has many levels of sectioning.
In the fashion of many GNU manuals (for instance the Make and
the Gawk manuals), I thought it might be nice to include a "Short
Contents". For those that don't know what I mean, I want to include
two tables of contents in my document, one which is a full table
of contents with all the possible sections included, and one which
just includes the larger sections (down to the tocdepth level that
I specify).

With LaTeX2HTML, you can set the tocdepth in a global fashion with a
command-line switch, but I don't see how to do what I'm talking about.
Since this is a wish, here are the things I would like to see in a 
final solution:

  - The ability to have multiple tables of contents, with a different
    tocdepth for each one.

  - The ability to optionally put any of the toc's on the first page
    (the top-level page) of a document.

  - The ability to optionally put a button in the navigation bar for
    each toc, e.g. 

      [Next] [Up] [Prev] [Contents] [Short Contents] [Index]


That's my wish. Maybe it's impossible or hard to do, I don't know.


As an aside, here's how I did it in LaTeX. The GNU manuals do it in
texinfo, so I couldn't use their structure. For LaTeX, after some
fumbling, I came up with this:

-------
 % Do a short table of contents.
 
 \setcounter{tocdepth}{1}
 \renewcommand{\contentsname}{Short Contents}
 % Turn off @-sign to modify @filesw.
 \catcode`\@=11
  % Turn file generation off, otherwise LaTeX starts a new toc which 
  % makes subsequent \tableofcontents commands use an empty file.
  \@fileswfalse  
   \tableofcontents \newpage
  \@fileswtrue
 \catcode`\@=12

 % Do a regular table of contents.
 
 \setcounter{tocdepth}{2}
 \renewcommand{\contentsname}{Table of Contents}
 \tableofcontents \newpage
-------

which works. I realize this is somewhat kludgy (especially with the
catcode workaround), but this was the easiest thing I came up with.
Better ideas for the LaTeX version are welcome...

-Mike

============================================================================
Dr. Michael L. Hall               <mailto:hall@lanl.gov>               
Los Alamos National Laboratory    <http://www.lanl.gov/home/Hall>      
P.O. Box 1663, MS-D409            Research: computational physics, radiation 
Los Alamos, NM 87545              transport, heat pipes, numerical modeling, 
ph: 505-665-4312                  fluid dynamics, magnetohydrodynamics       
============================================================================