How to add spoiler tags, edit posts, add images etc. How to - a user's guide to the new version of Boards
Mods please check the Moderators Group for an important update on Mod tools. If you do not have access to the group, please PM Niamh. Thanks!

# Strange hyper ref / htlatex problem

• Hosted Moderators Posts: 7,485 ✭✭✭

I have a strange problem with hyper ref and htlatex. If I put the following code in:
\documentclass{article}

\title{Demonstration of htlatex / hyperref / autoref problem}

\usepackage{hyperref}

\begin{document}

\maketitle

\section{Introduction}

I'm referring to \autoref{fig:my-sample-figure}, \autoref{tab:my-sample-table}  and \autoref{tab:my-second-sample-table}.

\begin{figure}[htbp]
\centering
Contents of My sample figure
\caption{My sample figure}
\label{fig:my-sample-figure}
\end{figure}

\begin{table}[htbp]
\centering
\begin{tabular}{l}
Content of my sample table
\end{tabular}
\caption{My sample table}
\label{tab:my-sample-table}
\end{table}

\begin{table}[htbp]
\centering
\begin{tabular}{l}
Content of my second sample table
\end{tabular}
\caption{My sample table}
\label{tab:my-second-sample-table}
\end{table}

\end{document}



The figure and table tables are incorrectly labelled section instead of Figure or Table, so the reference to the second table will come out as "section 2". It is hyperlinked though to the table, and the numbers are right.

I've got this issue on two Macs using the Mac Tex 2011 bundle, but strangely not on a Linux box using the TeXLive distribution. Has anyone else seen this?

• Seem to be fine when I build it with Miktex on Windows:

http://dl.dropbox.com/u/1500781/Demonstration%20of%20htlatex-hyperref-autoref%20problem.pdf

'Tis a strange one.

• Works fine for me on Miktex also. Very strange. I remember having a bizarre problem similar to this with figure captions before on TeXnicCenter and I couldn't figure out what was going wrong so as a last resort I copied and pasted everything onto a brand new .tex file and latexed that with TeXnicCenter the exact same way I was doing the previous document and somehow, bizarrely, that fixed the problem. . So did you try that?

• I've done it "clean" and also with the aux files etc all left there from a PDF run. It also doesn't just sort itself out even if you try running htlatex a few times. Hope this gets fixed in the next MacTex distro