5

I'm trying to use the backref option of BibLaTeX for back-referencing, but the pages in the bibliography link to the wrong pages (even though the pages listed are correct). The link appears to be systematically about 12 pages early (corresponding to the length of the frontmatter). Backref should be able to correctly link to a given page number, because the frontmatter is numbered with roman numerals whereas the mainmatter is numbered with arabic numerals, so the page numbers are unique (and I'm using the plainpages=false option of hyperref, as suggested here: Why does backref refer to wrong page?).

I tried to come up with a MWE, but I wasn't able to reproduce the error with a smaller example. Here's a fairly full example (I had to remove the comments to make it fit).

Contents of Thesis.tex:

\documentclass[11pt, a4paper, oneside]{Thesis}

\graphicspath{{./Figures/}}

\hypersetup{urlcolor=blue, colorlinks=true, plainpages=false}
\title{\ttitle}

\usepackage[style=authoryear-comp,citetracker=true,natbib=true,hyperref=true,backend=biber,maxbibnames=99,maxcitenames=2,firstinits=true,uniquename=init,parentracker=true,backref=true,backrefstyle=three]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A. and Buthor, B. and Cuthor, C.},
  year = {2001},
  title = {Alpha},
}
@misc{A02,
  author = {Duthor, D. and Euthor, E. and Futhor, F.},
  year = {2010},
  title = {Beta},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\DeclareNameAlias{sortname}{last-first}

\renewbibmacro{in:}{}

\AtEveryBibitem{
  \clearfield{month}{}
  \clearlist{language}{}
  }

\let\citealp\cite
\let\cite\textcite

\setlength\bibitemsep{0.5ex}
\setlength\bibnamesep{1.2ex}

\renewbibmacro*{volume+number+eid}{
  \setunit*{\addcomma\space}
  \textit{\printfield{volume}}
  \textit{\printfield{number}}
  \printfield{eid}}
  \DeclareFieldFormat[article]{number}{(#1)}

\DefineBibliographyStrings{english}{
backrefpage={cited on p\adddot},
backrefpages={cited on pp\adddot}
}

\DeclareFieldFormat{pages}{#1}

\DeclareFieldFormat[article]{title}{#1}
\DeclareFieldFormat[incollection]{title}{#1}
\DeclareFieldFormat[unpublished]{title}{#1}

\setcounter{biburllcpenalty}{7000}
\setcounter{biburlucpenalty}{8000}

\AtEveryCitekey{
  \ifciteseen{}{\defcounter{maxnames}{6}\clearfield{namehash}}}

\AtBeginBibliography{
  \renewcommand*{\finalnamedelim}{
    \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}
    \addspace\&\space}
}

\let\origparencite\parencite
\renewrobustcmd{\parencite}{
  \AtNextCite{
  \renewcommand*{\finalnamedelim}{
    \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}
    \addspace\&\space}
  }
  \origparencite
}

\makeatletter
\renewbibmacro*{cite}{
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\printtext[bibhyperref]{
          \DeclareFieldAlias{bibhyperref}{default}
          \usebibmacro{cite:label}
          \setunit{\addspace}
          \usebibmacro{cite:labelyear+extrayear}}
          \usebibmacro{cite:reinit}}
       {\iffieldequals{namehash}{\cbx@lasthash}
          {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                       \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
             {\setunit{\addcomma}
              \usebibmacro{cite:extrayear}}
             {\setunit{\compcitedelim}
              \usebibmacro{cite:labelyear+extrayear}
              \savefield{labelyear}{\cbx@lastyear}}}
          {\printtext[bibhyperref]{
             \DeclareFieldAlias{bibhyperref}{default}
             \printnames{labelname}
             \setunit{\nameyeardelim}
             \usebibmacro{cite:labelyear+extrayear}}
             \savefield{namehash}{\cbx@lasthash}
             \savefield{labelyear}{\cbx@lastyear}}}}
    {\usebibmacro{cite:shorthand}
     \usebibmacro{cite:reinit}}
  \setunit{\multicitedelim}}

\renewbibmacro*{textcite}{
  \iffieldequals{namehash}{\cbx@lasthash}
    {\iffieldundef{shorthand}
       {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                    \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
          {\setunit{\addcomma}
           \usebibmacro{cite:extrayear}}
          {\setunit{\compcitedelim}
           \usebibmacro{cite:labelyear+extrayear}
           \savefield{labelyear}{\cbx@lastyear}}}
       {\setunit{\compcitedelim}
        \usebibmacro{cite:shorthand}
        \global\undef\cbx@lastyear}}
    {\ifnameundef{labelname}
       {\printtext[bibhyperref]{
          \DeclareFieldAlias{bibhyperref}{default}
          \iffieldundef{shorthand}
            {\usebibmacro{cite:label}
             \setunit{
               \global\booltrue{cbx:parens}
               \addspace\bibopenparen}
             \ifnumequal{\value{citecount}}{1}
               {\usebibmacro{prenote}}
               {}
             \usebibmacro{cite:labelyear+extrayear}}
            {\usebibmacro{cite:shorthand}}
          \ifthenelse{\iffieldundef{postnote}\AND
                      \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}
            {\bibcloseparen
             \global\boolfalse{cbx:parens}}
            {}}}
       {\printtext[bibhyperref]{
          \DeclareFieldAlias{bibhyperref}{default}
          \printnames{labelname}
          \setunit{
            \global\booltrue{cbx:parens}
            \addspace\bibopenparen}
          \ifnumequal{\value{citecount}}{1}
            {\usebibmacro{prenote}}
            {}
          \iffieldundef{shorthand}
            {\iffieldundef{labelyear}
               {\usebibmacro{cite:label}}
               {\usebibmacro{cite:labelyear+extrayear}}
             \savefield{labelyear}{\cbx@lastyear}}
            {\usebibmacro{cite:shorthand}
             \global\undef\cbx@lastyear}
          \ifthenelse{\iffieldundef{postnote}\AND
                      \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}
            {\bibcloseparen
             \global\boolfalse{cbx:parens}}
            {}}
          \savefield{namehash}{\cbx@lasthash}}}
  \setunit{
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}
    \multicitedelim}}

\makeatother

\usepackage{units}
\usepackage{titlesec}
\usepackage{tabu} 
\usepackage{threeparttablex}
\usepackage{rotating}
\usepackage{lscape}
\usepackage{multirow}
\usepackage{afterpage}
\usepackage{hyperref}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\usepackage[]{graphicx}
\usepackage[]{color}

\makeatletter
\def\maxwidth{
  \ifdim\Gin@nat@width>\linewidth
    \linewidth
  \else
    \Gin@nat@width
  \fi
}
\makeatother

\definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}
\newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}

\usepackage{framed}
\makeatletter
\newenvironment{kframe}{
 \def\at@end@of@kframe{}
 \ifinner\ifhmode
  \def\at@end@of@kframe{\end{minipage}}
  \begin{minipage}{\columnwidth}
 \fi\fi
 \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
 \colorbox{shadecolor}{##1}\hskip-\fboxsep
     \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}
 \MakeFramed {\advance\hsize-\width
   \@totalleftmargin\z@ \linewidth\hsize
   \@setminipage}}
 {\par\unskip\endMakeFramed
 \at@end@of@kframe}
\makeatother

\definecolor{shadecolor}{rgb}{.97, .97, .97}
\definecolor{messagecolor}{rgb}{0, 0, 0}
\definecolor{warningcolor}{rgb}{1, 0, 1}
\definecolor{errorcolor}{rgb}{1, 0, 0}
\newenvironment{knitrout}{}{}

\usepackage{alltt}
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}

\begin{document}

\frontmatter

\setstretch{1.3}

\fancyhead{}
\rhead{\thepage}
\lhead{}

\pagestyle{fancy}

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\hypersetup{pdftitle={\ttitle}}
\hypersetup{pdfsubject=\subjectname}
\hypersetup{pdfauthor=\authornames}
\hypersetup{pdfkeywords=\keywordnames}

\begin{titlepage}
\begin{center}

\textsc{\LARGE \univname}\\[1.5cm]
\textsc{\Large Doctoral Thesis}\\[0.5cm]

\HRule \\[0.4cm]
{\huge \bfseries \ttitle}\\[0.4cm]
\HRule \\[1.5cm]

\begin{minipage}{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
\href{http://www.google.com}{\authornames}
\end{flushleft}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
\href{http://www.google.com}{\supname}
\end{flushright}
\end{minipage}\\[3cm]

\large \textit{A thesis submitted in fulfillment of the requirements\\ for the degree of \degreename}\\[0.3cm]
\textit{in the}\\[0.4cm]
\groupname \\ of the\\\deptname\\[2cm]

{\large \today}\\[4cm]

\vfill
\end{center}

\end{titlepage}

\Declaration{

\addtocontents{toc}{\vspace{1em}}

I, \authornames, declare that this thesis titled, `\ttitle' and the work presented in it are my own. I confirm that:

\begin{itemize} 
\item[\tiny{$\blacksquare$}] This work was done wholly or mainly while in candidature for a research degree at this University.\\
\end{itemize}

Signed:\\
\rule[1em]{25em}{0.5pt}

Date:\\
\rule[1em]{25em}{0.5pt}
}

\clearpage

\pagestyle{empty}

\null\vfill

\textit{``Quote''}

\begin{flushright}
Author
\end{flushright}

\vfill\vfill\vfill\vfill\vfill\vfill\null

\clearpage

\addtotoc{Abstract}

\abstract{\addtocontents{toc}{\vspace{1em}}

The Thesis Abstract is written here
}

\clearpage

\setstretch{1.3}

\acknowledgments{\addtocontents{toc}{\vspace{1em}}

Acknowledments text.

}
\clearpage

\pagestyle{fancy}

\lhead{\emph{Contents}}
\tableofcontents

\lhead{\emph{List of Figures}}
\listoffigures

\lhead{\emph{List of Tables}}
\listoftables

\clearpage

\setstretch{1.5}

\lhead{\emph{Abbreviations}}
\listofsymbols{ll}
{
\textbf{Acronym} & \textbf{W}hat (it) \textbf{S}tands \textbf{F}or \\
}

\clearpage

\lhead{\emph{Physical Constants}}

\listofconstants{lrcl}
{
Speed of Light & $c$ & $=$ & $2.997\ 924\ 58\times10^{8}\ \mbox{ms}^{-\mbox{s}}$ (exact)\\
 Constant Name & Symbol & = & Constant Value (with units) \\
}

\clearpage

\lhead{\emph{Symbols}}

\listofnomenclature{lll}
{
$a$ & distance & m \\
$P$ & power & W (Js$^{-1}$) \\

& & \\

$\omega$ & angular frequency & rads$^{-1}$ \\
}

\setstretch{1.3}

\pagestyle{empty}

\dedicatory{Dedication text.}

\addtocontents{toc}{\vspace{2em}}

\mainmatter

\pagestyle{fancy}

\section{Introduction}
Test 1 \citep{A01}.

\clearpage
Test 2 \citep{A02}.

\addtocontents{toc}{\vspace{2em}}

\appendix

\addtocontents{toc}{\vspace{2em}}

\backmatter

\label{Bibliography}
\lhead{\emph{Bibliography}}
\printbibliography
\end{document}

Contents of Thesis.cls:

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{Thesis}
              [2007/22/02 v1.0
   LaTeX document class]
\def\baseclass{book}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\def\@checkoptions#1#2{
  \edef\@curroptions{\@ptionlist{\@currname.\@currext}}
  \@tempswafalse
  \@tfor\@this:=#2\do{
    \@expandtwoargs\in@{,\@this,}{,\@curroptions,}
    \ifin@ \@tempswatrue \@break@tfor \fi}
  \let\@this\@empty
  \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
}
\@checkoptions{11pt}{{10pt}{11pt}{12pt}}
\PassOptionsToClass{a4paper}{\baseclass}
\ProcessOptions\relax
\LoadClass{\baseclass}
\newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}

\newcommand\Declaration[1]{
\btypeout{Declaration of Authorship}
\addtotoc{Declaration of Authorship}
\thispagestyle{plain}
\null\vfil
\begin{center}{\huge\bf Declaration of Authorship\par}\end{center}
{\normalsize #1}
\vfil\vfil\null
}

\newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space \number\year}
\usepackage{setspace}
\onehalfspacing
\setlength{\parindent}{0pt}
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
\usepackage{vmargin}

\RequirePackage[utf8]{inputenc}

\setmarginsrb  { 1.5in}
                        { 0.6in}
                        { 1.0in}
                        { 0.8in}
                        {  20pt}
                        {0.25in}
                        {   9pt}
                        { 0.3in}
\raggedbottom
\setlength{\topskip}{1\topskip \@plus 5\p@}
\doublehyphendemerits=10000
\brokenpenalty=10000
\widowpenalty=9999
\clubpenalty=9999
\interfootnotelinepenalty=9999
\usepackage{fancyhdr}
\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}}
\renewcommand{\sectionmark}[1]{}
\renewcommand{\subsectionmark}[1]{}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
\theoremstyle{plain}
\newtheorem{example}{Example}[chapter]
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{axiom}[theorem]{Axiom}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\usepackage[centerlast,small,sc]{caption}
\setlength{\captionmargin}{20pt}
\newcommand{\fref}[1]{Figure~\ref{#1}}
\newcommand{\tref}[1]{Table~\ref{#1}}
\newcommand{\eref}[1]{Equation~\ref{#1}}
\newcommand{\cref}[1]{Chapter~\ref{#1}}
\newcommand{\sref}[1]{Section~\ref{#1}}
\newcommand{\aref}[1]{Appendix~\ref{#1}}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\dbltopfraction}{.85}
\renewcommand{\floatpagefraction}{0.75}
\renewcommand{\dblfloatpagefraction}{.75}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[scriptsize]{subfigure}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{listings}
\usepackage{lstpatch}
\lstset{captionpos=b,
        frame=tb,
        basicstyle=\scriptsize\ttfamily,
        showstringspaces=false,
        keepspaces=true}
\lstdefinestyle{matlab} {
        language=Matlab,
        keywordstyle=\color{blue},
        commentstyle=\color[rgb]{0.13,0.55,0.13}\em,
        stringstyle=\color[rgb]{0.7,0,0} }
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
   bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,
   colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red},
   pdfstartview={FitV},unicode,breaklinks=true]{hyperref}
\pdfstringdefDisableCommands{
   \let\\\space
}
\newcommand*{\supervisor}[1]{\def\supname{#1}}
\newcommand*{\thesistitle}[1]{\def\ttitle{#1}}
\newcommand*{\examiner}[1]{\def\examname{#1}}
\newcommand*{\degree}[1]{\def\degreename{#1}}
\newcommand*{\authors}[1]{\def\authornames{#1}}
\newcommand*{\addresses}[1]{\def\addressnames{#1}}
\newcommand*{\university}[1]{\def\univname{#1}}
\newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}}
\newcommand*{\department}[1]{\def\deptname{#1}}
\newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}}
\newcommand*{\group}[1]{\def\groupname{#1}}
\newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}}
\newcommand*{\faculty}[1]{\def\facname{#1}}
\newcommand*{\FACULTY}[1]{\def\FACNAME{#1}}
\newcommand*{\subject}[1]{\def\subjectname{#1}}
\newcommand*{\keywords}[1]{\def\keywordnames{#1}}

\thesistitle{Thesis Title}
\supervisor{Dr. Faculty \textsc{Name}} 
\examiner{}
\degree{Doctor of Philosophy}
\authors{My \textsc{Name}}
\addresses{}
\subject{}
\keywords{}
\university{\texorpdfstring{\href{http://www.iub.edu}
                {University}}
                {University}} 
\UNIVERSITY{\texorpdfstring{\href{http://www.iub.edu}
                {UNIVERSITY}}
                {UNIVERSITY}}
\department{\texorpdfstring{\href{http://psych.indiana.edu/index.php}
                {Department}}
                {Department}}
\DEPARTMENT{\texorpdfstring{\href{http://psych.indiana.edu/index.php}
                {DEPARTMENT}}
                {DEPARTMENTS}}
\group{\texorpdfstring{\href{http://psych.indiana.edu/clinical.php}
                {Research group}}
                {Research group}}       
\GROUP{\texorpdfstring{\href{http://psych.indiana.edu/clinical.php}
                {RESEARCH GROUP}}
                {RESEARCH GROUP}}
\faculty{\texorpdfstring{\href{http://psych.indiana.edu/faculty/batesj.php}
                {Faculty}}
                {Faculty}}
\FACULTY{\texorpdfstring{\href{http://psych.indiana.edu/faculty/batesj.php}
                {FACULTY)}}
                {FACULTY}}

\renewcommand\maketitle{
  \btypeout{Title Page}
  \hypersetup{pdftitle={\@title}}
  \hypersetup{pdfsubject=\subjectname}
  \hypersetup{pdfauthor=\authornames}
  \hypersetup{pdfkeywords=\keywordnames}
  \thispagestyle{empty}
  \begin{titlepage}
    \let\footnotesize\small
    \let\footnoterule\relax
    \let \footnote \thanks
    \setcounter{footnote}{0}
    \null\vfil
    \vskip 60\p@
    \begin{center}
      \setlength{\parskip}{0pt}
      {\large\textbf{\UNIVNAME}\par}
      \vfill
      {\huge \bf \@title \par}
      \vfill
      {\LARGE by \par}
      \smallskip
      {\LARGE \authornames \par}
      \vfill
      {\large A thesis submitted in partial fulfillment for the \par}
      {\large degree of \degreename \par}
      \bigskip
      \bigskip
      {\large in the \par}
      {\large \facname \par}
      {\large \deptname \par} 
      \bigskip
      \bigskip
      \bigskip
      {\Large \@date \par}
      \bigskip
    \end{center}
    \par
    \@thanks
    \vfil\null
  \end{titlepage}
  \setcounter{footnote}{0}
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
  \cleardoublepage
}
\newenvironment{abstract}
{
  \btypeout{Abstract Page}
  \thispagestyle{empty}
  \null\vfil
  \begin{center}
    \setlength{\parskip}{0pt}
    {\normalsize \UNIVNAME \par}
    \bigskip
    {\huge{\textit{Abstract}} \par}
    \bigskip
    {\normalsize \facname \par}
    {\normalsize \deptname \par}
    \bigskip
    {\normalsize \degreename\par}
    \bigskip
    {\normalsize\bf \@title \par}
    \medskip
    {\normalsize by \authornames \par}
    \bigskip
  \end{center}
}
{
  \vfil\vfil\vfil\null
  \cleardoublepage
}
\addtocounter{secnumdepth}{1}
\setcounter{tocdepth}{6}
\newcounter{dummy}
\newcommand\addtotoc[1]{
\refstepcounter{dummy}
\addcontentsline{toc}{chapter}{#1}}
\renewcommand\tableofcontents{
\btypeout{Table of Contents}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\contentsname
        \@mkboth{
           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
    \@starttoc{toc}
    \if@restonecol\twocolumn\fi
   \cleardoublepage
}\end{spacing}
}
\renewcommand\listoffigures{
\btypeout{List of Figures}
\addtotoc{List of Figures}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
      \@mkboth{\MakeUppercase\listfigurename}
              {\MakeUppercase\listfigurename}}
    \@starttoc{lof}
    \if@restonecol\twocolumn\fi
    \cleardoublepage
}\end{spacing}
}
\renewcommand\listoftables{
\btypeout{List of Tables}
\addtotoc{List of Tables}
\begin{spacing}{1}{
    \setlength{\parskip}{1pt}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listtablename
      \@mkboth{
          \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
    \@starttoc{lot}
    \if@restonecol\twocolumn\fi
    \cleardoublepage
}\end{spacing}
}
\newcommand\listsymbolname{Abbreviations}
\usepackage{longtable}
\newcommand\listofsymbols[2]{
\btypeout{\listsymbolname}
\addtotoc{\listsymbolname}
    \chapter*{\listsymbolname
      \@mkboth{
          \MakeUppercase\listsymbolname}{\MakeUppercase\listsymbolname}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
    \cleardoublepage
}
\newcommand\listconstants{Physical Constants}
\usepackage{longtable}
\newcommand\listofconstants[2]{
\btypeout{\listconstants}
\addtotoc{\listconstants}
    \chapter*{\listconstants
      \@mkboth{
          \MakeUppercase\listconstants}{\MakeUppercase\listconstants}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
    \cleardoublepage
}
\newcommand\listnomenclature{Symbols}
\usepackage{longtable}
\newcommand\listofnomenclature[2]{
\btypeout{\listnomenclature}
\addtotoc{\listnomenclature}
    \chapter*{\listnomenclature
      \@mkboth{
          \MakeUppercase\listnomenclature}{\MakeUppercase\listnomenclature}}
\begin{longtable}[c]{#1}#2\end{longtable}\par
    \cleardoublepage
}
\newcommand\acknowledgments[1]{
\btypeout{Acknowledgments}
\addtotoc{Acknowledgments}
\thispagestyle{plain}
\begin{center}{\huge{\textit{Acknowledgments}} \par}\end{center}
{\normalsize #1}
\vfil\vfil\null

}
\newcommand\dedicatory[1]{
\btypeout{Dedicatory}
\thispagestyle{plain}
\null\vfil
\vskip 60\p@
\begin{center}{\Large \sl #1}\end{center}
\vfil\null
\cleardoublepage
}
\renewcommand\backmatter{
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \addtotoc{\bibname}
  \btypeout{\bibname}
  \@mainmatterfalse}
\endinput

To run, you may need lstpatch.sty, which can be downloaded from here: http://www.atscire.de/download/lstpatch.sty

Bonus points: How can I remove the extra space after the opening parenthesis in each of the parenthetical citations?

  • Can you extend your example to make it compilable And shows the problem? – Johannes_B Dec 18 '13 at 8:27
  • Just updated with a full example. I had to remove the comments for it to fit, so let me know if there's anything I can clarify. Thanks! – itpetersen Dec 18 '13 at 14:57
  • This is definitely coming from the class. Let me have a look. – Johannes_B Dec 18 '13 at 15:04
  • Is this the template found here? Why didn't you just provide a link? The thesis itself loads hyperref, and not in a very intelligent way. Hyperref should be loaded last (there are a few exceptions), everything you load yourself is therefore loaded after hyperref. Things like backref are broken by default. Either change the template (removing hyperref and loading it yourself) or drop the template as a whole. I would suggest the latter. – Johannes_B Dec 18 '13 at 15:32
  • Your response was very helpful. Thanks! I got the template from here: latextemplates.com/template/masters-doctoral-thesis. I wasn't sure if it had changed since I downloaded it, though. Any ideas how to remove the extra space after the opening parenthesis in each of the parenthetical citations? – itpetersen Dec 18 '13 at 16:13
3

The template/class you are using is loading hyperref. But hyperref should be, with some exceptions, loaded last. The documentation of biblatex clearly says, that backreferencing will only work, when hyperref is loaded after biblatex.
You have to either delete everything related to hyperref in the .cls and input it in your own preamble.

You should never modify a class or package file, since every change will be lost when updating. In your template, modifying is not only encouraged, but needed to get everything right. This can't be a quality mark. I would drop this template entirely.

Concerning the whitespace in your references:
You need to be careful when (re-)defining own command, since LaTeX treats the end of line as a single space. You can cover those with a comment character (%). Read more about it at What is the use of percent signs (%) at the end of lines?
For example, the first space after the opening bracket (_ is covered/removed here:

\AtEveryCitekey{%<- This % is needed
\ifciteseen{}{\defcounter{maxnames}{6}\clearfield{namehash}}}

You can easily find things like that on your own by using the methods to prepare a minimal working example.

  • I have the same Thesis class and the same problem. As you advised, I moved everything related to hyperref in the .cls to my own preamble but the problem remained. Could you please write what specifically should be moved? Maybe I will have to post my own question as I have a second issue with this class (fonts in the bibliography). – wondering Apr 19 '15 at 11:10
  • Drag everything related to hyperref to the end of your preamble. I cannot know what you have in there, but you will receive helping messages from LaTeX. Opening a new question might be a good idea, though. – Johannes_B Apr 19 '15 at 11:21
  • It did not help to move everything to hyperref. However, I just discover this solution, which finally works without doing anything else! The hyperref option hypertexnames must be set to true. Because I have no idea why it works, I am a little concerned about possible other consequences, but for the moment it seems all right. – wondering Apr 19 '15 at 13:09
2

After numerous months of battling with this and trying all manners of suggested solutions, I finally found a method that works for me. My thesis class uses "report" (as opposed to "book" or "article") and my frontmatter has no page numbers. There are 8 pages of frontmatter (this was important for diagnosing). My table of contents and list of figures have roman page numbers, and the rest of the thesis has arabic page numbers. Just like the OP, biblatex backrefs to pages 1-8 would link to the corresponding frontmatter page instead of the correct one. Backrefs to page 9 and beyond would link correctly.

My solution relies on resetting the page counter. I know this is frowned upon, but let me illustrate, as I reset the page counter for the roman pages, not the arabic ones:

\singlespacing{\maketitle}             

%start counting pages in roman, but they won't show since dedication et c. are empty pagestyle
\cleardoublepage
\pagenumbering{roman} 

\include{dedication}        % include a dedication.tex file
\include{acknowledgements}   % include an acknowledgements.tex file
\include{abstract}          % include the abstract.tex file

\cleardoublepage
\setcounter{page}{1}  % resets the ROMAN page counter to 1 for the TOC

\tableofcontents       % generate and include a tbl of contents

\listoffigures              % generate and include a list of figures

\cleardoublepage
\pagenumbering{arabic} %change to arabic counting. Resets to 1 automatically

\doublespacing %works right through thesis

%now include the latex source files for each of the chapters

\include{chapter1-intro}
\include{nextchapter}
...

\cleardoublepage
...

\printbibliography[heading=bibintoc] % ensure the bib is linked in TOC
\end{document}

The key was to start the page numbering right after the title page. The dedication, acknowledgements, abstract et c. were all of empty pagestyle, so the page numbers did not show. I then reset the page number at the TOC, which is the first time the roman page numbers display. I then set the page numbering style to arabic before including the actual content.

For reference, my biblatex import looks like this:

\usepackage[natbib=true,
    style=authoryear-comp,
    hyperref=true,
    backend=biber,
    maxbibnames=99,
    firstinits=true,
    uniquename=false,
    uniquelist=false,
    useprefix=true, %for `van', `von' et c.
    maxcitenames=1,
    parentracker=true,
    url=false,
    doi=false,
    isbn=false,
    eprint=false,
    backref=true,
    bibencoding=auto,
    sortcites=false,
    sorting=anyt, %sort the citations by increasing year (oldest first)
    ]{biblatex}

Hope this helps!

0

As already emphazised by someone in the comments the solution is set to the hyperref option hypertexnames must be set to true. No matter if the class is preloaded. E.g. in MastersDoctoralThesis Class the preload comment is

\AtEndPreamble{\RequirePackage{hyperref}
\hypersetup{pdfpagemode={UseOutlines},
bookmarksopen=true,
bookmarksopenlevel=0,
hypertexnames=true,
colorlinks=true,% Set to false to disable coloring links
citecolor=mycitecolor!\myshade!black,% The color of citations
linkcolor=mylinkcolor!\myshade!black,% The color of references to document elements (sections, figures, etc)
urlcolor=myurlcolor!\myshade!black,% The color of hyperlinks (URLs)
pdfstartview={FitV},
unicode,
breaklinks=true,
}

As you see, I had change hypertexnames=true,. That solved the problem of wrong backreference.

  • Hm, the question is about Thesis, but you are talking about MastersDoctoralThesis. Are you sure they are the same? I'm not ... – Mensch Jul 4 at 2:21
  • It worked for me in both classes. – Hodek Mealstrom Jul 4 at 3:01

Your Answer

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

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