Cross-Referencing – Best Practices for Cross-References in LaTeX Documents

cross-referencing

When I click on the link of a reference (equation, image, section…) it sends me to the beginning of the page where the reference is and not to its exact location.
how do I get the link to send me to the exact location of the reference?

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{kpfonts}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\usepackage{hyperref}

\begin{document}

When I click on the link of a reference (equation, image, section...) it
sends me to the beginning of the page where the reference is and not to 
its exact location. how do I get the link to send me to the exact 
location of the reference?

 \begin{equation}
 B=A+C
 \label{eq1}
 \end{equation}

 \newpage
 This is the link to the equation \ref{eq1}

 \end{document}

Best Answer

  • Your code works fine.
  • I have tested (1) Overleaf, (2) Adobe Reader, and (3) PDF-XChange Editor.
  • It may be the case that the built-in PDF viewer of Texmaker does not work 100 % but if that is the case that it is a problem of Texmaker and not a problem of the code or the PDF file (= good for you).

\documentclass{article}

\usepackage{hyperref}

\begin{document}

When I click on the link of a reference (equation, image, section...) it
sends me to the beginning of the page where the reference is and not to 
its exact location. how do I get the link to send me to the exact 
location of the reference?

 \begin{equation}
 B=A+C
 \label{eq1}
 \end{equation}

 \newpage
 This is the link to the equation \ref{eq1}

 \end{document}
Related Question