[l2h] custom_titles affects counters in image file

Ross Moore ross at ics.mq.edu.au
Tue Jan 15 01:28:34 CET 2008


Hello Nicola,

On 15/01/2008, at 1:22 AM, nlct at cmp.uea.ac.uk wrote:

> Hi,
>
> When I used -custom_titles, the sectioning counters in the image  
> file are
> out by a factor of 2.
>
> Minimal example:
>
> \documentclass{report}
>
> \author{Nicola Talbot}
> \title{Test Document}
>
> \begin{document}
> \maketitle
>
> \chapter{Introduction}
>
> This is chapter~\thechapter. % This is fine
>
> \fbox{This is chapter~\thechapter.} % counter value incorrect in image
>
> \section{Sample Section}
>
> This is section~\thesection. % This is fine
>
> \fbox{This is section~\thesection.} % counter value incorrect in image
>
> \end{document}

Normally it is not a good idea to include counter-values
within images. There are several aspects about the way
that LaTeX2HTML works that makes it hard to ensure that
the LaTeX counters have the correct values at the time
when the images are created.

However...

>
> latex2html.init file:
>
> $CUSTOM_TITLES=1;
> sub custom_title_hook{
>   my($title)=@_;
>   &purify($title);
> }
>
> For every \chapter, the image file contains 2 \stepcounter{chapter}
> (likewise for \section.)
>
> I'm using LaTeX2HTML Version 2002 (1.67)
>
> I've noticed that in &make_name if either $LONG_TITLES or  
> $CUSTOM_TITLES
> are set latex2html calls
>
> &process_command($sections_rx, $_) if /^$sections_rx/;
>
> (lines 9296 and 9302)
>
> but &translate also has this on line 2304 regardless of  
> $LONG_TITLES or
> $CUSTOM_TITLES. Is it these lines that add \stepcounter{chapter} to  
> the
> image file?

  ... since you seem to be prepared to delve into the Perl scripts,
you could try writing your own versions of these subroutines.
Put them into an initialization file, so that they override the
one's that LaTeX2HTML provides.

If this works for you, then you have the behaviour that you require.
I'll then try to determine why the original coding was wrong,
and whether it is always wrong or only sometimes wrong.
That is necessary to decide how best to fix it.


>
> Regards
> Nicola Talbot

Hope this helps,

	Ross Moore

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------




More information about the latex2html mailing list