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

孤者浪人 提交于 2019-12-02 16:41:30

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.

michalko

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.

user2916497
\usepackage{hyperref}
\usepackage{caption}

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!