Okay, I've got a suggestion for a fix for some of the problems I
mentioned earlier. Please bear with me through the length of this
email --- the actual problems are really fairly minor. My final
recommendation is to include all the fixes Ross Moore suggested
earlier, and add an asterisk or two!

The first bug was shown by this file:

------Begin File--------
 \documentclass{report}

 \begin{document}

I ran this with L2H v98.2beta8 -show_section_numbers.

Bug #1:

With standard L2H v98.2beta8, even numbered lines below are
misaligned if they start with a percent sign.

With L2H v98.2beta8 incorporating Ross's fixes, the lines below
are all aligned correctly.

 \begin{verbatim}
    % Line 1
    % Line 2
    % Line 3
    % Line 4
    % Line 5
    % Line 6
    Line 1
    Line 2
    Line 3
    Line 4
    Line 5
    Line 6
 \end{verbatim}

Bug #1a:

With standard L2H v98.2beta8, the line below is present.

With L2H v98.2beta8 incorporating Ross's fixes, the line below is absent.

 \begin{verbatim}
    % Line 1
 \end{verbatim}

 \end{document}
------End File--------

Ross suggested this fix, alluded to in the file above:

> Fix this with 3 simple edits.
> Here are context-diffs, showing the un-edited code,
> followed by the edited version, as it appears at my site,
> and will soon be committed to the CVS repository.
> (The line numbers should not be expected to be accurate,
> but should be close to correct at any installed LaTeX2HTML site.)
> 
> ***************
> *** 1473,1480 ****
>       &preprocess_alltt if defined(&preprocess_alltt);
> 
>       # Move all LaTeX comments into a local list
> !     s/([ \t]*(^|[^\\]))(%.*)\n[ \t]*/print "%";
>         $comments{++$global{'verbatim_counter'}} = "$3";
>         &write_mydb("verbatim", $global{'verbatim_counter'}, $3);
>         "$1$comment_mark".$global{'verbatim_counter'}."\n"/mge;
> 
> --- 1477,1486 ----
>       &preprocess_alltt if defined(&preprocess_alltt);
> 
>       # Move all LaTeX comments into a local list
> ! #    s/([ \t]*(^|[^\\]))(%.*)\n[ \t]*/print "%";
> !     s/([ \t]*(^|[^\\]))(%.*(\n[ \t]*|$))/print "%";
>         $comments{++$global{'verbatim_counter'}} = "$3";
>         &write_mydb("verbatim", $global{'verbatim_counter'}, $3);
>         "$1$comment_mark".$global{'verbatim_counter'}."\n"/mge;
> 
> ***************
> *** 1518,1524 ****
>             $contents =~ s/^\n+//;
> 
>             # re-insert comments
> !           $contents =~ s/$comment_mark(\d+)/$comments{$1}/g;
>   #         $contents =~ s/$comment_mark(\d+)/$verbatim{$1}/g;
> 
>             # revert '\\ ' -> '\\' only once
> --- 1524,1531 ----
>             $contents =~ s/^\n+//;
> 
>             # re-insert comments
> !           $contents =~ s/$comment_mark(\d+)\n/$comments{$1}/g;
>   #         $contents =~ s/$comment_mark(\d+)/$verbatim{$1}/g;
> 
>             # revert '\\ ' -> '\\' only once
> ***************
> *** 1546,1552 ****
>             }
>         } else {
>             print "Cannot find \\end{$env}\n";
> !           $after =~ s/$comment_mark(\d+)/$comments{$1}/g;
>   #         $after =~ s/$comment_mark(\d+)/$verbatim{$1}/g;
>             if ($env =~ /rawhtml|$keepcomments_rx/i) {
>                   $after = &revert_to_raw_tex($contents);
> --- 1553,1559 ----
>             }
>         } else {
>             print "Cannot find \\end{$env}\n";
> !           $after =~ s/$comment_mark(\d+)\n/$comments{$1}/g;
>   #         $after =~ s/$comment_mark(\d+)/$verbatim{$1}/g;
>             if ($env =~ /rawhtml|$keepcomments_rx/i) {
>                   $after = &revert_to_raw_tex($contents);
> ***************

This fixes the alignment problem, but creates a new problem, described
in Bug 1a in the file above. While not understanding all of the logic
involved in the least, I guessed and was able to fix Bug 1a by adding
an asterisk as follows:

>             # re-insert comments
> !           $contents =~ s/$comment_mark(\d+)\n*/$comments{$1}/g;
                                                ^^^ - here

You might also need one as follows, I don't know:

>             print "Cannot find \\end{$env}\n";
> !           $after =~ s/$comment_mark(\d+)\n*/$comments{$1}/g;
                                             ^^^ - here

There still seems to be an extra vertical space (carriage return) in
the output after a single line verbatim environment (as in Bug 1a),
but that doesn't bother me a whole lot. I imagine that Ross might be
able to fix that too.

Now, on to Bug 2. It is shown by this file:

------Begin File--------
 \documentclass{report}

 \begin{document}

I ran this with L2H v98.2beta8 -show_section_numbers.

Bug #2:

Note in the following table of contents that the appendix
subsections are numbered A1.1 instead of A.1.1 (there's a period
missing):

\chapter{First Chapter}
  \section{waa}
   \subsection{waawaa}

\appendix
\chapter{An Appendix}
  \section{waa}
   \subsection{waawaa}

 \end{document}
------End File--------

Ross suggested this fix:

> Yes, add the missing '.' in the main latex2html script, as follows:
>  
> sub do_cmd_the_appendix {
>     local($val,$level) = (0,@_[0]);
>     if ($level == 3) { $val=$global{'section'} }
>     elsif ($level == 2) { $val=$global{'chapter'} }
>     join('', &fAlph($val), '.', @_[1]);
>                          ^^^^^__________ here !!!
> }

I *incorrectly* reported that this didn't fix the problem. In reality,
it *does* fix the problem.

So, Ross's fixes should be incorporated in the new version (they're
not currently there), along with my asterisk suggestion (or some
better fix to Bug 1a by someone who knows more about it).

BTW, is it time to freeze L2H V98.2 and let new updates modify a
V99.1 ? Or maybe we should just call the latest version 99.1 ?

-Mike

============================================================================
Dr. Michael L. Hall               <mailto:[EMAIL PROTECTED]>               
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       
============================================================================

Reply via email to