[latex2html] Re: [l2h] Problems with book class

Ross Moore Ross Moore <ross@ics.mq.edu.au>
Sat, 9 Dec 2000 12:26:30 +1100 (EST)


> I ran into trouble with converting segmented documents with the book class. On
> the mailing list archive I found the following message from awhile ago:
> 
> ------------------------------------------------------------------------Inserted
> Hello!
> 
> I have to convert several books to html, so i tested segmented report
> example in L2H distribution (v99.2b8) with only \documentclass changed to book
> and section to chapter in \segment's second argument (and \subsection
> to \section in sec1.tex) 

Yes; there is a problem with the heading-levels...
 
> -- Table of contents, List of figures and Index have lower level with
> respect to chapters in child list,
> 
> -- Index appears before chapter, not after,
> 
> -- Contents node lacks Chapters (only Contents, List of Fig. and Index).
> 
> -- subsection (now section) number is 3.1, not 1.1
> 
> And the last two occurs even without any changes in distribution!
> 
> Which are bugs and which are features?
> 
> Vadim
> -----------------------------------------------------------------End----Inserted
> 
> 
> I have similar problems. If I include the following in my main document:
> 
> \tableofcontents
> \listoffigures
> \listoftables
> 
> \segment{intro}{chapter}{Introduction}
> \segment{part1}{chapter}{Models in continuous time}
> \endsegment[chapter]


 ... which occurs when the top-level source file
has no explicit \chapter or \part commands.


Here is what needs to be fixed (in  latex2html.pin , then reinstall):

sub set_depth_levels {
    # Sets $outermost_level
    local($level);
    #RRM:  do not alter user-set value for  $MAX_SPLIT_DEPTH
    foreach $level ("part", "chapter", "section", "subsection",
                    "subsubsection", "paragraph") {
        last if (($outermost_level) = /\\($level)$delimiter_rx/);
#
#RRM: insert some more tests at this point.
#
        last if (($outermost_level) = /\\endsegment\s*\[\s*($level)\s*\]/s);
        if (/\\segment\s*($O\d+$C)[^<]+\1\s*($O\d+$C)($level)\s*\2/s)
                { $outermost_level = $3; last };
#
# end of extra tests
#
    }


With this patch, the $outermost_level is now detected correctly,
and the example sets the TOC, LOF, Index etc. at the correct level,
and links them in the correct order.


> Thanks,
> Andre
> 

Thanks for the bug report.

Hope this helps,

	Ross Moore


 
> +-------------------------------------------
> |  Andre M. de Roos
> |  Population Biology section
> |  University of Amsterdam
> |  P.O.Box 94084
> |  NL - 1090 GB Amsterdam, The Netherlands
> |  Phone:       +31-20 525 7747
> |  Fax:         +31-20 525 7754
> |  E-mail:      aroos@bio.uva.nl
> +-------------------------------------------