# Apparent conflict between hyperref and tex4ht packages

I am trying to use both the hyperref and tex4ht packages to format a textbook into a web textbook. Everything works except if I comment out chapter one, but if I include chapter one in the document, I get:

/usr/local/texlive/2011/texmf-dist/tex/generic/tex4ht/hyperref.4ht:314: LaTeX Error: Command \Hy@SectionHShift already defined.
Or name \end... illegal, see p.192 of the manual in '.


I tried using savesym to resolve the conflict but it didn't seem to work. Any ideas? I have no idea why only chapter one of the document doesn't work... there is no difference between it and any of the other chapters.

Also, I created this very simple document to see if I could use hyperref and tex4ht there, but it comes up with the exact same error that I pasted above:

\documentclass{article}
\usepackage[html]{tex4ht}
\usepackage{hyperref}
\title{hello}
\author{Me}
\begin{document}
\maketitle
\section{The first}

\section{The second}

\href{www.amazon.com}{amazon}

\end{document}


If anyone has any ideas, I would be much obliged.

-
I only get the error if I compile with pdflatex. Your example works if I use latex or htlatex. –  Ian Thompson Jun 20 '12 at 21:01
@IanThompson you could turn your comment into an answer. –  Gonzalo Medina Jun 20 '12 at 22:16
I don't think one has to \usepackage{tex4ht} which is loaded automatically when htlatex is called. –  egreg Jun 20 '12 at 22:21

I only get the error if I compile with pdflatex. Your example works if I use latex or htlatex.
@JaneJones you can pass these options to htlatex as htlatex filename "html,3,sections+" –  michal.h21 Jun 20 '12 at 23:22