I'm currently modifying the Masters/Doctoral Thesis template found here. However, it only highlights the year in a citation like (Smith 2016). I would like both "Smith" and "2016" to be part of the link. I have added a MWE below. It includes the main tex file, the cls file and the bib file. What should be changed?
main.tex
\documentclass[11pt]{MastersDoctoralThesis}
\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex}
\addbibresource{adam.bib}
\begin{document}
This is in \cite{smith2016}.
\end{document}
MastersDoctoralThesis.cls
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\newcommand{\classname}{MastersDoctoralThesis}
\ProvidesClass{\classname}[2015/11/08 v1.2 LaTeXTemplates.com]
\providecommand{\baseclass}{book}
\RequirePackage{etoolbox}
\RequirePackage{xparse}
\LoadClass{\baseclass}
\RequirePackage{hyperref}
\hypersetup{
bookmarksopen=true,
bookmarksopenlevel=0,
hypertexnames=false,
colorlinks=true,
citecolor=blue,
linkcolor=blue,
urlcolor=blue,
pdfstartview={FitV},
unicode,
breaklinks=true,
}
\endinput
adam.bib
@article{smith2016,
author={John Smith},
year={2016}
}
PDF Output

\documentclasscommand, has a minimal preamble and then\begin{document}...\end{document}. Unless the problem is a compilation error, the code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much ore likely that they will! – Feb 09 '16 at 23:35.clsfile if you wish, but then you need to make sure thatbiblatexis loaded. Note also that this exact solution will only works absolutely smoothly with theauthoryearstyle. It can also go into the preamble of your.texfile. – moewe Feb 10 '16 at 15:01.clsdepends on what your.clsis supposed to do. If it is just for this (and maybe a few other) special documents, than it is fine I suppose; if you want to make the.clsre-usable (with other bibliography styles) and allow for more flexibility, moving the code there might not be that good an idea after all. – moewe Feb 10 '16 at 15:11biblatextwice (i.e. you have\usepackage[...]{biblatex}twice in total), load it only once. – moewe Feb 10 '16 at 17:03MastersDoctoralThesis.clsis not the file. Please see the license at the beginning of the class file. – Johannes_B Feb 11 '16 at 17:04\RequirePackage[style=authoryear]{biblatex}instead of\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex}as you did before you are requesting the Biber back-end and are not using BibTeX any more, you need to adapt your compilation sequence please read bibtex vs. biber and biblatex vs. natbib, Biblatex with Biber: Configuring my editor to avoid undefined citations. – moewe Feb 12 '16 at 06:57.clsfile without changing its name. I would also be against movingbiblatexcode (and even the call to\usepackage{biblatex}) to a multi-purpose.clssuch as this, if you insist on keeping your preamble short (why?) you can externalise it to a personal.texor.styfile you can later load. But don't change the.clsfile. – moewe Feb 12 '16 at 07:00