Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}

A link:
\url{www.google.com}

\section{The second}

Another link:
\href{www.amazon.com}{amazon}

\end{document}

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

share|improve this question
    
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
1  
I don't think one has to \usepackage{tex4ht} which is loaded automatically when htlatex is called. –  egreg Jun 20 '12 at 22:21

1 Answer 1

I only get the error if I compile with pdflatex. Your example works if I use latex or htlatex.

share|improve this answer
    
You're right, I just tried it and that's true for me too. However, it still creates an error with my more complex document(this applies whether or not I take out \usepackage{tex4ht} or not). It starts telling me that I have an error in almost every line... and this is a document that compiles just fine when I don't have the tex4ht or hyperref packages. Again, the other chapters work fine. Thanks! –  Jane Jones Jun 20 '12 at 22:36
    
Also, in the book I'm using: \usepackage[html,3,sections+]{tex4ht} so I think I do need to keep that in explicitly... although I'm not entirely sure at this point. –  Jane Jones Jun 20 '12 at 22:45
    
Sorry for my mess of comments, I'm new to this forum. I just wanted to add one last thing, which is that without explicitly including the package tex4ht with the html option, even the simple document does not format correctly as an html document. Thanks again. –  Jane Jones Jun 20 '12 at 22:54
    
@JaneJones you can pass these options to htlatex as htlatex filename "html,3,sections+" –  michal.h21 Jun 20 '12 at 23:22
    
Even if I use that syntax "htlatex filename "html,3,sections+", if I include hyperref, I still can't format a complex document without getting this error: /usr/local/texlive/2011/texmf-dist/tex/generic/tex4ht/hyperref.4ht:314: LaTeX E rror: Command \Hy@SectionHShift already defined. Or name \end... illegal, see p.192 of the manual in `'. –  Jane Jones Jun 22 '12 at 21:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.