[tex4ht] hyperref loaded in document class

Denis Bitouzé dbitouze at wanadoo.fr
Tue Oct 2 13:14:34 CEST 2012


Hello,

if hyperref is loaded in the document class, TeX4ht complains:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
l.48 --- TeX4ht warning --- tex4ht loaded after hyperref ---
l.230 --- TeX4ht warning --- \usepackage[...]{hyperref} assumes `pdf'
option, n ot `tex4ht' ---

! LaTeX Error: Command \Hy at SectionHShift already defined.
               Or name \end... illegal, see p.192 of the manual in `'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.314 \newlength\Hy at SectionHShift
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This can be tested with the following MCE:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents*}{aclass.cls}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{aclass}
    [2012/10/02 0.1 A class]
\LoadClass{article}
\RequirePackage{hyperref}
\endinput
\end{filecontents*}
\documentclass{aclass}
\begin{document}
Test.
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Do you know a workaround?

Note that the trouble doesn't arise if hyperref is loaded in a package:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents*}{apackage.sty}
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{apackage}
    [2012/10/02 0.1 A package]
\RequirePackage{hyperref}
\endinput
\end{filecontents*}
\documentclass{article}
\usepackage{apackage}
\begin{document}
Test.
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Thanks by anticipation.
-- 
Denis


More information about the tex4ht mailing list