0

I have the case that \ref (also \cref) point to the page of the label, but not directly the label.

How can I make it point to the label directly?

Example which uses the ICML 2021 template:

\documentclass{article}

\usepackage{hyperref}
\usepackage{icml2021}

\begin{document}
\section{Intro}
\label{sec:intro}
Intro.

\section{Conclusion}
As seen in section \ref{sec:intro}.

\end{document}

It seems to be related to the ICML template. When I comment out the \usepackage{icml2021}, it works.

5
  • As you know, you should add a minimal example. But typically this means a \phantomsection is missing ... – Ulrike Fischer Jan 26 at 15:07
  • 1
    That \ref{sec:intro} seems to work as exepected. In my Evince it moves me right above 1 Intro. To be move obvious I added \newpage test \newpage to the Conclusion on a separate page. Please specify exactly which latex installation you are using. – daleif Jan 26 at 15:27
  • @daleif: I use Texlive 2018 (on MacOSX). So, when the Intro section is in the middle of the page, it jumps exactly there to the middle? For me, it just jumps to the page, but not exactly to the place. – Albert Jan 26 at 16:45
  • To me it jumps such that 1 Intro is right at the top of the page (this of course depends on the viewer and your zoom. – daleif Jan 26 at 16:51
  • I just noticed, when I swap the order of icml2021 and hyperref, it works correctly. – Albert Jan 26 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.