[l2h] latex2html doesn't work anymore with tetex 3.0?
Ross Moore
ross at ics.mq.edu.au
Thu Mar 17 12:24:31 CET 2005
Hi Robin, and others,
On 16/03/2005, at 4:34 AM, Robin Fairbairns wrote:
> \ifx\undefined\hyperref
> \ifx\pdfoutput\undefined \let\pdfunknown\relax
> \let\html at new=\newcommand
> \else
> \ifx\pdfoutput\relax \let\pdfunknown\relax
> \RequirePackage{hyperref}\let\html at new=\renewcommand
> \else
> \RequirePackage{hyperref}\let\html at new=\newcommand
> \fi
> \fi
> \else
> \let\html at new=\renewcommand
> \fi
>
> now, in a modern latex, \pdfoutput is always going to be a primitive,
> so the above is never going to believe it's running plain latex even
> when it is. the check should "\pdfoutput defined && \pdfoutput>0" --
> this was always the case, except now it bites everyone rather than
> people who do marginal things.
>
> it may be that there's something newer than 2002-2-1, but my mirror's
> not picked it up (latex2html gets into ctan via the cambridge node).
> whatever, whoever writes this stuff should look at
> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ifpdf if they've not
> already tidied up the above code.
While I agree with what you say about detecting which mode pdfetex
now runs in, that is not really what the above code is doing.
It cannot be the cause of loading hyperref.sty with the wrong driver,
since html.sty makes no mention of which driver to load ---
it simply wants to know whether it is loaded already,
and if not there are some circumstances when it forces it to load.
The problem reported by Mike Fabian in fact has nothing
to do with hyperref driver after all.
Instead it is a symptom of bugs that have been dormant in both
html.sty and hyperref.sty for some time now,
concerning the \htmladdimg and \hyperimage commands.
Here's a patch to fix html.sty :
--- /usr/local/teTeX/share/texmf-local/tex/latex/html/html.sty Tue Sep
3 17:09:33 2002
+++ test/html.sty Thu Mar 17 21:44:43 2005
@@ -74,7 +74,7 @@
\ifx\pdfunknown\relax
\html at new{\htmladdimg}[1]{}
\else
- \def\htmladdimg#1{\hyperimage{#1}}
+ \def\htmladdimg#1{\hyperimage{#1}{[#1]}}
\fi
@@ -538,7 +538,7 @@
\ifx\pdfunknown\relax
\renewcommand{\htmladdimg}[2][]{}
\else
- \renewcommand{\htmladdimg}[2][]{\hyperimage{#2}}
+ \renewcommand{\htmladdimg}[2][]{\hyperimage{#2}{[#2]}}
\fi
%%% HTMLRULE for LaTeX2e
Notice that formerly \hyperimage was being called with
only a single argument, when it is in fact expecting 2 of them.
This error is perhaps due to the fact that on page 45
of "The LaTeX Web Companion" it is described as having just
a single argument --- even though it isn't implemented
that way within hyperref.sty .
This still leaves an error in hyperref.sty
in the following chunk of coding:
\let\htmladdimg\hyperimage
\def\htmladdnormallink#1#2{\href{#2}{#1}}
\def\htmladdnormallinkfoot#1#2{\href{#2}{#1}\footnote{#2}}
Here the aim is for hyperref to process LaTeX source that was
actually written for use with LaTeX2HTML. However, the line
\let\htmladdimg\hyperimage
is quite wrong, since the two commands take different
numbers/shapes of arguments:
\htmladdimg [ ...HTML specific stuff... ] {<URL>}
\hyperimage {<image URL>}{<anchor text>}
It would be better to have a definition here of the form:
\providecommand{\htmladdimg}[2][]{\hyperimage{#2}{[#2]}}
Note that if the LaTeX document loads html.sty
then this defect in hyperref.sty is bypassed.
Only if the source was written for LaTeX2HTML, but
the author
a. failed to load html.sty , and
b. uses the \htmladdimg command
is there any problem.
This is very rare, and technically incorrect
--- but stranger things have happened.
The incorrect documentation in LWC is likely to
cause more problems.
I hope this helps everyone get LaTeX2HTML working
again on their own platforms, with pdfetex .
Cheers,
Ross
>
> robin
>
------------------------------------------------------------------------
Ross Moore ross at maths.mq.edu.au
Mathematics Department office: E7A-419
Macquarie University tel: +61 +2 9850 8955
Sydney, Australia fax: +61 +2 9850 8114
------------------------------------------------------------------------
More information about the latex2html
mailing list