Advertisement
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

  • #1
    Hosted Moderators Posts: 7,485 ✭✭✭ Red Alert


    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}
    \author{Red Alert}
    
    \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?


Comments

Advertisement