[tex4ht] \autoref from hyperref with tex4ht

Martin Heller mr_heller at yahoo.dk
Fri Dec 30 13:25:39 CET 2011


Radhakrishnan CV wrote, on 11-05-2011 08:16:
> Attached is a newer version of nameref.4ht. In my tests, this version
> seems to fix the problem of not only \autoref, but also \nameref which
> was also broken. If this version passes your tests, I shall update the
> literate sources and nameref.4ht in the SVN.
>
> Look forward to hearing from you.

The following document when compiled with
	htlatex test-nameref.tex "html,4"
generates wrong targets for the subsection and subsubsection references 
with the updated nameref.4ht. The targets for the links are correct with
% nameref.4ht                           2010-09-04-21:02 %
% Copyright (C) 2005--2010       Eitan M. Gurari         %
distributed with MikTeX.


% test-nameref.tex
\documentclass{book}
\usepackage{hyperref}

\setcounter{secnumdepth}{4}

\begin{document}

\chapter{Chapter}
\label{chap:chapter}

\section{Section}
\label{sec:section}

\subsection{Subsection}
\label{subsec:section}

\subsubsection{Subsubsection}
\label{subsubsec:section}

\begin{equation}
	a\label{eq:a}
\end{equation}


\begin{figure}
\caption{Figure.}
\label{fig:test}
\end{figure}

\chapter{Second Chapter}
\autoref{eq:a}\\
\autoref{fig:test}\\
\autoref{chap:chapter}\\
\autoref{sec:section}\\
\autoref{subsec:section}\\
\autoref{subsubsec:section}\\

Equation~(\ref{eq:a})\\
Figure~\ref{fig:test}\\
Chapter~\ref{chap:chapter}\\
Section~\ref{sec:section}\\
Subsection~\ref{subsec:section}\\
Subsubsection~\ref{subsubsec:section}

\end{document}



More information about the tex4ht mailing list