I am typing my thesis in LaTeX. I used hyperref
. Two papers are in the bibliography. Paper no 1 is cited in the first page and paper no 2 is cited in the 2nd page.
When I am clicking the red coloured number below the paper number 1 in the bibliography it is pointing wrongly to the title page of the document. But there is NO PROBLEM with paper no 2. Please help me. I want the paper number 1 to point the correct page.
Also in my document, I don't want "Chapter 0, Synopsis". I want only "Synopsis" i.e. no mention of chapter 0 mark. This I want only for this chapter not in the later chapters. I also want synopsis to occur in the content of the document. Please help me to figure out this.
I am attaching my .tex
code below.
\documentclass[12pt, reqno, a4paper]{book}
\usepackage{fancyhdr}%, setspace}
\usepackage[pagebackref]{hyperref}
\hypersetup{
colorlinks = true, linkcolor = red,
citecolor = blue,
urlcolor = blue,
}
\begin{document}
\begin{titlepage}
\begin{center}
{\bf Title page}
\end{center}
\end{titlepage}
\pagestyle{plain}
\pagenumbering{roman}
\addtocounter{page}{1}
%\thispagestyle{empty}
$\textnormal{ }$
\vspace{9cm}
\begin{center}
{\bf \Large{To my Parents}}
\end{center}
{\Large
\tableofcontents}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\renewcommand{\headrulewidth}{0.1pt}
\renewcommand{\footrulewidth}{0.1pt}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\lfoot{Anjan Gupta, TIFR, Mumbai.}
\pagenumbering{arabic}
\setcounter{chapter}{-1} % to start Chapter numbers from 0
\chapter{synopsis}
\setcounter{page}{1}
In \cite[Theorem 4.1]{cr} it is shown that this is indeed true in the absolute case.
\newpage
we shall now use the result \cite{sfmaa}
\begin{thebibliography}{VAST}
\bibitem{cr} Paper 1.
\bibitem{sfmaa} Paper 2.
\end{thebibliography}
\end{document}
Best Answer
The
chapter
issue has been solved in comments, so I tried to address the duplicate page anchors.There's another solution which should be the last resort, proposed by Werner, but he deleted his answer, so not everybody is able to see that post, so I am repeating this just for convenience and in short:
hypertexnames=false
Now,
hypertexnames
is often criticized, so I digged into the awesome codes ofbackref
andhyperref
.The cause for the complaints about
name(page.1)
etc. is that the\pagenumbering
macro resets thepage
number each time it\pagenumbering
is called, resulting in more than one pages with the number1
, which confuses the hyperlinks. Using\clearpage
statementss, this could solve the issue. If this is not done, more tricky setups have to be used.I solved this by patching the
\Hy@EveryPageAnchor
command, injecting a\pagenumberingchanges
macro betweenpage
and.\thepage
(effectively).\pagenumberingchanges
uses\thepagenumberingcalls
, which is the counter formater forpagenumberingcalls
, which is stepped each time\pagenumbering
is used.In addition, this
\pagenumberingchanges
macro has to be written to the.brf
file generated bybackref
each time a\cite
command is applied.This removes the multiple occurences of the same
page.XYZ
anchors, however, it is not failsafe, if somebody manipulates the page counter directly or with\setcounter{page}{}
.The links are alright now and point to the correct position.
Update with a version that checks whether the pagenumbering value has changed
Related, but different problem can be found here: https://tex.stackexchange.com/a/373678/31729