LaTeX and its packages need several compilation runs to get everything correct. For example hyperref
can't place a link forwards in the document in the very first run because that part of the document wasn't processed yet. Therefore it stores this information in the auxiliary file(s) and reads them back in at the next run. Unknown destinations are simply replaced by the first page.
You simply need to compile the document at least twice, sometimes three times (if e.g. the table-of-content turns out to take more than one page and pushes the rest of the document further down).
I would recommend to use a compiler tool which runs all the nesseary steps in the right order and the right number of times for you. Many LaTeX editors do this for you. There is also the latexmk
script which will do the job very well. For PDF output use latexmk -pdf filename
.
If this doesn't fix your issue please try to provide a minimal working example (MWE) that recreates your problem. We would also need which tools you are using (OS, LaTeX distribution, the steps you takes, ...)
bibtex
.