Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
href to an image label - how to jump to the image instead of the caption below the image?

It appears that the links to the figures take the cursor to the figure label, where the label is at the top of the page. This makes the reader have to scroll up to see the figure. Also, the footnotes take me either to the previous page or sometimes it keeps me on the same page but takes the PDF to a full page view of the same page. What am I doing wrong?

MWE code:

\documentclass[12pt]{article}

\usepackage{float}
\usepackage{verbatim}
\usepackage[margin=1in]{geometry} 
\usepackage{graphicx}            
\usepackage{amsmath}              
\usepackage{amsfonts}              
\usepackage{amsthm}                
\usepackage{harvard}
\usepackage{setspace}
\usepackage{fullpage}
\usepackage{threeparttable}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{hyperref}
\usepackage[titletoc,toc,page]{appendix}
\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{conj}[thm]{Conjecture}



\begin{document}
\nocite{*}

\title{Hpperref not working}

\author{N00b}

\maketitle
\newpage
\section{Main}

It appears that the links to the figures, like here for Figure ~\ref{fig:mweref}, take   the cursor to the figure label, where the Label is at the top of the page. This makes the reader have to scroll up to see the figure. Also, the footnotes, like this one \footnote{containing really useful stuff}, takes me either to the previous page or when I remove the newpage command after my title, it takes me  to the pdf with the full page view of the same page. What am I doing wrong? Thanks. 
\begin{figure}[H]
\centering
\includegraphics[scale=0.55]{mweref}
\caption{mweref}\label{fig:mweref}
\end{figure}
\end{document}

This PDF file is output that my TeXnicCenter is producing.

share|improve this question
add comment

marked as duplicate by Werner, zeroth, Claudio Fiandrino, lockstep, Heiko Oberdiek Oct 16 '12 at 8:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 5 down vote accepted

For the first issue, you can use the hypcap package:

\usepackage{hyperref}
\usepackage[all]{hypcap}

From the package documentation:

This package tries a solution of the problem with hyperref, that links to floats points below the caption and not at the beginning of the float. Therefore this package divides the task into two part, the link setting with \capstart or automatically at the beginning of a float and the rest in the \caption command.

For the second issue, it's a well known fact that hyperref's support for fotnotes can be easily broken as the following quote from the hyperref manual indicates:

Makes the footnote marks into hyperlinks to the footnote text. Easily broken ...

However, your minimal example doesn't allow me to reproduce the problem you mentioned. Perhaps you could consider deactivating hyperlinks for footnotes?

\usepackage[hyperfootnotes=false]{hyperref}

You could also try some of the suggestions given in the answers to Error with hyperref + tabular + footnotes in tabular

share|improve this answer
    
awesome! First issue fixed. Thanks! –  Amatya Oct 16 '12 at 2:40
    
@Amatya please see my updated answer regarding the footnotes issue (perhaps you could edit your original question providing an example reproducing the problem? Another option is to suppress hyperlinks in footnotes as I suggested). –  Gonzalo Medina Oct 16 '12 at 2:46
    
@Amatya new updated: I added a link to a previous question that might be helpful. –  Gonzalo Medina Oct 16 '12 at 3:14
    
@Gonzola Medina The MWE and the pdf it produced, which I have linked to when I wrote This is my output.. at least on my computer has the issue with footnotes. Was the attached pdf working fine on your computer? –  Amatya Oct 16 '12 at 4:29
    
@Amatya the attached pdf doen't have active hyperlinks (it's just an image). Processing your MWE the hyperlink for the footnote behave as expected. –  Gonzalo Medina Oct 16 '12 at 11:56
show 1 more comment

This can be fixed with they hypcap package, loaded as

\usepackage[all]{hypcap}        % needed to help hyperlinks direct correctly;

Note that this is one of the few packages that needs to be loaded after the hyperref package. There are a few others, detailed in Which packages should be loaded after hyperref instead of before?

Note that I've stripped your code down to a MWE- a lot of the packages were unnecessary in replicating the problem.

\documentclass[12pt]{article}

\usepackage{float}
\usepackage[margin=1in]{geometry} 
\usepackage[demo]{graphicx}            
\usepackage{hyperref}
\usepackage[all]{hypcap}        % needed to help hyperlinks direct correctly;

\begin{document}
\nocite{*}

\title{Hpperref not working}

\author{N00b}

\maketitle
\newpage
\section{Main}
 It appears that the links to the figures, like here for Figure ~\ref{fig:mweref}, take   the cursor to the figure label, where the Label is at the top of the page. This makes the reader have to scroll up to see the figure. Also, the footnotes, like this one \footnote{containing really useful stuff}, takes me either to the previous page or when I remove the newpage command after my title, it takes me  to the pdf with the full page view of the same page. What am I doing wrong? Thanks. 
 \begin{figure}[H]
\centering
\includegraphics[scale=0.55]{mweref}
\caption{mweref}\label{fig:mweref}
\end{figure}
\end{document}
share|improve this answer
    
Thanks a lot! I included all those packages because I wasn't sure where the problem lay. I tried your code and while the figure issue is fixed, the footnote is still acting up. –  Amatya Oct 16 '12 at 2:46
    
@Amatya can you meet me in the chat room? –  cmhughes Oct 16 '12 at 2:55
    
I'm sorry I only just got your message. I was offline for 2 hours. I'll lurk around the chat rooms for a bit to see if you're there or I'll try to catch you in the next few days. Thanks –  Amatya Oct 16 '12 at 4:31
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.