EDIT:@runartrollet: I clarify the problem. THe pdf outputs as expected the links in every instance of the commands autoref
and nameref
. and\fullref
, starred or not. But the html
file, the command
-
fullref without star
has no underlined link for the title of the section
[whereas the non-starredautoref
andnameref
individually behaves well] -
fullref with star
does link-ify thechapitre+section number+section title
, but it is does not replace thelabel
of the section with the actualtitle of the section
-
nameref
without star does not work in html
=================================================
I have a problem with hyperref+make4ht
when I use autoref
and nameref
. I use a command \fullref
found here.
compiled with make4ht -ul hello.tex
, my output is
the problem comes from the star
after \nameref
:
this is a comment from the page above:
I have added the star for \nameref that I have forgotten in the comment. The star forms prevent nested double links. – Heiko Oberdiek Jun 30 '13 at 23:32
We see that my label
MYLABEL
is not always taken by make4ht
\documentclass{article}
%%%\usepackage{alternative4ht}
%%%\altusepackage{fontspec}
\usepackage{hyperref}
%%% for babel
%\addto\extrasenglish{\def\equationautorefname~#1\null{Equation~(#1)\null}}
\def\equationautorefname~#1\null{%
Equation~(#1)\null
}
\def\sectionautorefname{chapitre}
\newcommand*{\fullref}[1]{\hyperref[{#1}]{\autoref{#1}...\nameref{#1}}}
\newcommand*{\fullrefwithstar}[1]{\hyperref[{#1}]{\autoref*{#1}...\nameref*{#1}}}
\begin{document}
%\tableofcontents
fullref without star: \fullref{sec:MYLABEL},\\
autoref without star : \autoref{MYLABEL}\\
nameref without star : \nameref{sec:MYLABEL}\\
ref: \ref{MYLABEL}\\
\section{Excellences...}\label{sec:MYLABEL}\label{MYLABEL}
fullref with star: \fullrefwithstar{sec:MYLABEL},\\
autoref with star : \autoref*{sec:MYLABEL}\\
nameref with star : \nameref*{sec:MYLABEL}\\
ref with star: \ref*{sec:MYLABEL}\\
\end{document}
Best Answer
edit: I've posted a patch at tex4ht bug tracker, it should be fixed in TeX Live soon.
There is missing support for
\nameref*
command intex4ht
configuration filehyperref.4ht
, it seems. Missing\@namerefstar
command is reported during compilation. This is strange, astex4ht
does normally support commands defined in packages out of the box, it needs to configure only commands where we need specific formatting usually. The culprit is thathyperref.sty
detectstex4ht
and it stops it's own loading before the command is defined. Anyway, we can just copy definition of this command fromhyperref.sty
at suitable place inhyperref.4ht
:The full
hyperref.4ht
is now following:and this is a result when we compile your document: