Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Strange hyper ref / htlatex problem

  • 26-01-2012 7:27pm
    #1
    Hosted Moderators Posts: 7,486 ✭✭✭


    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

  • Registered Users, Registered Users 2 Posts: 13,104 ✭✭✭✭djpbarry


    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.


  • Registered Users, Registered Users 2 Posts: 26,578 ✭✭✭✭Turtwig


    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. :confused::confused:. So did you try that? :D


  • Hosted Moderators Posts: 7,486 ✭✭✭Red Alert


    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 :)


Advertisement