Simple question: When I use cleveref
and \Cref{}
or \cref{}
I am able to compile the code and produce a PDF. When I use htlatex
I get ??
in place of what I expect would be the object name and section number.
Following a modified form of the the example MWE found How can I make \cref{foo,bar} from cleveref work with htlatex? as included below, I would like to figure out what the requirements to use htlatex
and cleveref
together are? I was sure that in the last couple of weeks trying to get this to work that I have stumbled across successfully compiled html files that included the text and number expected by a \cref{}
or \Cref{}
command, but never in a stable reproducible format.
\documentclass{report}
\ifdefined\HCode
\usepackage{tex4ht}
\usepackage[tex4ht]{hyperref}
\else
\usepackage{hyperref}
\fi
\usepackage{etoolbox}
\AtEndPreamble{\usepackage{cleveref}}
\begin{document}
\section{\label{foo}foo}
%\cref{bar,baz} - this won't compile but the problem is deeper rooted because cref alone doesn't work.
%\protect\cref{foo}
\cref{baz} follows \cref{bar}
\section{bar}\label{bar}
\section{baz}\label{baz}
\end{document}
I have also tried the example (slightly modified with solution incorporated) How can I make amsthm and cleveref to work with htlatex?
\documentclass{article}
\usepackage{hyperref}
\usepackage{amsthm}
\AtBeginDocument{\usepackage{cleveref}}
\newtheorem{thm}{Theorem}[section]
\newtheorem{rmk}[thm]{Remark}
\begin{document}
\begin{rmk}\label{test}
Test content
\end{rmk}
See the test found in \cref{test}
\end{document}
So in collecting enough information to understand why this isn't working, I would like to know:
Is there a
cleveref
option similar to\usepackage[tex4ht]{hyperref}
that should be usedIs there a known bug or compatibility problem - Why does htlatex not work as expected?
Is there a command line option that can be added to
htlatex test.tex
that is fundamental and missing (I am suspicious of this possibility because of the reference to my second example. If the solution here was to ensurecleveref
is loaded last in the preamble, and my obvious issue of??
appearing in place of actual references was present, then I am sure it would have been followed up.