[l2h] Looking for section/navigation info

Rhonda Hyslop 0402tug at write-on.org
Fri Feb 13 00:48:29 CET 2004

* Rhonda Hyslop <0402tug at write-on.org> [12 Feb 2004 09:39]:
> I have no problem with doing this in perl instead of LaTeX - in fact
> that's what I assumed I would have to do, from within the
> top_navigation_panel subroutine. What I'm having trouble with is
> figuring out where I can find 1) a variable with all of the section
> titles, numbers, and filenames that I can parse to build my menu, and 2)
> some indicator of what section is currently being processed. latex2html
> obviously knows what section it's working on when it runs
> top_navigation_panel and builds the next and previous links, because it
> does them correctly.

Thanks to everybody who offered help. Wouldn't you know it, after asking
then getting a good night's sleep, I figured it out.

I'm describing what I learned here just in case anybody else is
searching for ways of customizing the latex2html navigation panel beyond
just the next and previous default links.

This may not be the most efficient way of doing it, but it works for me

For my question 1) the variable %section_info did indeed have what I was
looking for. For anybody else looking for this information, it's a hash
keyed on the numeric section key, and the value is a string that can be
easily split on the delimiter %:% to get the section level (section = 3,
subsection = 4, and so on; I had found the definition of the different
levels in the code earlier), the name of the html file the section is
stored in, and the title of the section, in that order. By looking at
the key and the level to determine where in the menu structure it
belonged I could easily create a link from the title and filename.

For my question 2) the variable $key held the numeric section key of the
section currently being processed, in exactly the same format as the key
used in the hash described above.

And now, with a bit of processing on those two variables, I have exactly
the sidebar menu I wanted. It even expands and shows all the subsections
that are "siblings" of the current subsection, while leaving all the
other sections collapsed but listed for easy navigation.

 www.write-on.indy || www.write-on.org   \/  http://history.ubcengineers.ca/
  Discuss the art and craft of writing   /\   UBC Engineers History Project
   That's the problem with world domination. Nobody is willing to wait for 
   it anymore, work slowly towards it, drink more and enjoy the ride more.

More information about the latex2html mailing list