Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tex4ht and hyperref

0 views
Skip to first unread message

Peter Broer

unread,
Aug 19, 2006, 8:33:07 AM8/19/06
to
L.S.,

Since the August update of the hyperref package I'm having problems with
producing html files with tex4ht from tex files that contain both
bibliographic references and the hyperref package. tex4ht stops at the
first reference to be produced with a "Missing \endcsname inserted."

I'm not sure whether this is a tex4ht issue or a hyperref issue (or
maybe even a MikTeX issue), so I am posting here. I use the most recent
versions of both packages, MikTeX 2.5 and Windows XP, SP2. The problem
is exactly the same with MikTeX 2.4 on my laptop, and it doesn't arise
on my latex installation at work, where I also use MikTeX 2.4, and
haven't updated my packages since the beginning of July.

Minimal example:

***file test.tex***
\documentclass[11pt,a4paper]{article}%
\usepackage{natbib}
\usepackage{hyperref}
\begin{document}

\href{http://www.cpb.nl/eng/org/homepages/dpb/}{Peter Broer}

Macroeconomics at the level of \cite{Romer01}.

\bibliography{test}
\bibliographystyle{plainnat}

\end{document}

***file test.bib***
@Book{Romer01,
author = {Romer, P.},
title = {Advanced Macroeconomics},
edition = {2nd},
year = {2001},
publisher = {Mc Graw-Hill}
}


Command sequence to generate the problem:
latex test.tex
bibtex test
htlatex test.tex

If I remove the hyperlink and the hyperref package from test.tex, a
correct html file is produced.

The htlatex.bat file used is the one contained in
http://www.tug.org/applications/tex4ht/fix/newt4ht.zip (version June 19,
2006).

The log file of the htlatex command is a bit long, and I'm not sure that
it is needed for a diagnosis. If so, it can be downloaded from
http://home.tiscali.nl/peterbroer/test.log

Thanks in advance,

best regards,

Peter Broer

Heiko Oberdiek

unread,
Aug 19, 2006, 9:22:56 AM8/19/06
to
Peter Broer <peter...@gmail.com> wrote:

Test file without bibtex stuff:

\documentclass[11pt,a4paper]{article}%
\usepackage{natbib}
\usepackage{hyperref}
\begin{document}

\tracingmacros=1


Macroeconomics at the level of \cite{Romer01}.

\tracingmacros=0

\begin{thebibliography}{1}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi: #1}\else
\providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi

\bibitem[Romer(2001)]{Romer01}
P.~Romer.
\newblock \emph{Advanced Macroeconomics}.
\newblock Mc Graw-Hill, 2nd edition, 2001.

\end{thebibliography}

\end{document}

ChangeLog of hyperref:

| * "color" options also support the optional argument (color
| model) of \color.

Changed are internal commands: \Hy@colorlink, the implementation
documentation says:

% |\Hy@colorlink| expects a macro as argument. It contains
% the color specification.

Thus tex4ht that uses this internal command needs fixing:

| \def\hyper@linkstart#1#2{%
| \Hy@colorlink{\csname @#1color\endcsname}%
| \def\Hy@tempa{#1}%
| \ifx\Hy@tempa\@urltype
| \Link[#2]{}{}%
| \else
| {\hyper@chars\ifx\rel:hyper\def\Link{#2}{}\else\Link[\##2]{}{}\fi}%
| \fi \global\let\rel:hyper=\:UnDef
| }

Fix:
\expandafter\Hy@colorlink\csname @#1color\endcsname

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Eitan M Gurari

unread,
Aug 19, 2006, 10:31:01 PM8/19/06
to
>Fix:
> \expandafter\Hy@colorlink\csname @#1color\endcsname

Done. Thanks, -eitan


0 new messages