[tex4ht] Undefined control sequence. when loading package breakurl package with tex4ht

Michal Hoftich michal.h21 at gmail.com
Sun Nov 22 10:20:01 CET 2015


Hi Nasser,

> 
> This MWE
> 
> ---------------------------
> \documentclass[11pt]{article}%
> \usepackage[T1]{fontenc}
> \usepackage{hyperref}
> \usepackage[hyphenbreaks]{breakurl}
> \begin{document}
> \url{http://www.google.com}
> \end{document}
> ------------------------
> 
> Compiles with pdflatex and lualatex but gives syntax error with htlatex:

This package checks for PDF mode, which is why it works with pdflatex
and luatex. In dvi mode, it tries to insert some postscript specials,
and it does it before point where redefined hooks are inserted by
tex4ht. This means that we can't fix that with some .4ht file. Only
solutions is either to modify your preamble to not include the package
with tex4ht, or to contact the author and let him know about the issue.
The package is almost ten years old, so I am not sure whether the
contact mail still works though. I would propose a following fix, which
is based on a code used when the pdf mode is detected:

\@ifpackageloaded{tex4ht}{%
  % Dummy package options
  \DeclareOptionX{preserveurlmacro}{}
  \DeclareOptionX{hyphenbreaks}{}
  \DeclareOptionX{anythingbreaks}{}
  \DeclareOptionX{vertfit}{}
  \ProcessOptionsX\relax

  \PackageWarning{breakurl}{%
   You are using breakurl while processing via tex4ht.\MessageBreak
        \string\burl\space will be just a synonym of \string\url.\MessageBreak}
  \DeclareRobustCommand{\burl}{\url}
  \DeclareRobustCommand*{\burlalt}{\hyper at normalise\burl at alt}
  \def\burl at alt#1#2{\hyper at linkurl{\Hurl{#1}}{#2}}
  \expandafter\endinput
}{}

Best regards,
Michal


More information about the tex4ht mailing list