How to make a hyperlink navigate to the top of the figure in LaTeX when using hyperref?

前端 未结 3 1113
别跟我提以往
别跟我提以往 2021-01-30 21:45

I have a LaTeX document with a figure and references to it:

\\begin{figure}
...
\\caption{...}
\\label{fig:1}
\\end{figure}

\\ref{fig:1}

I use

相关标签:
3条回答
  • 2021-01-30 22:09

    Add this in your preamble

    \usepackage{hyperref}
    \usepackage[all]{hypcap}    %for going to the top of an image when a figure reference is clicked
    

    Make sure that the \usepackage[all]{hypcap} is written after the hyperref package is imported.

    0 讨论(0)
  • 2021-01-30 22:10
    \usepackage{hyperref}
    \usepackage{caption}
    

    Using this is a better idea than \usepackage[all]{hypcap}.

    0 讨论(0)
  • 2021-01-30 22:15

    To previous comment:

    \usepackage{hyperref}
    \usepackage{caption}
    

    is slightly better than \usepackage[all]{hypcap} because when you use e.g. figure without captions there won't be a compilation problem. The caption package by default sets option

    hypcap=true
    

    anchoring hyperlinks to the beginning of an environment.

    0 讨论(0)
提交回复
热议问题