1

MWE:

\documentclass{amsart}
\usepackage{hyperref}

\newtheorem{theorem}{Theorem}

\begin{document}
\begin{theorem}\label{thm}
  This is a theorem.
\end{theorem}

\begin{proof}[Proof of Theorem~\ref{thm}]
  This is a proof.
\end{proof}
\end{document}

Compiled with make4ht, one gets

[ERROR]   htlatex: ./test.tex   11   Extra \else.

There is no error if hyperref package is not included. It is also worth to mention that, this issue also appears if we replace \begin{proof}[Proof of Theorem~\ref{thm}] by \begin{proof}[Proof of Theorem~\hyperref[thm]{some theorem}].

I wonder the reason and a workaround. Thanks.

1 Answer 1

0

This issue was caused by removing of some supplemental code for Hyperref in TeX4ht. This was done because of clashes with BibLaTeX. As I found also other issues caused by this change, I've reintroduced the original code back to TeX4ht sources. In the meantime, you can use local copy of the hyperref-hooks.4ht file:

% hyperref-hooks.4ht (2021-12-08-12:41), generated from tex4ht-4ht.tex
% Copyright 2021 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version 2021-12-08-12:41}

% we don't have any code here for now
\:AtEndOfPackage{%
\@ifpackageloaded{nameref}{}
{%
   \let\sv:label\label
   \RequirePackage{nameref}%
   \let\label\sv:label
   %\input nameref.4ht
}}

Your example now compiles without errors:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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