The following is what I am doing now.
\documentclass[11pt,english]{extarticle}
\usepackage{listings}
\lstset{language=Matlab}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{booktabs}
\usepackage{float}
\usepackage{color}
\usepackage[title,titletoc,toc]{appendix}
\usepackage[nohead]{geometry}
\usepackage[bottom]{footmisc}
\usepackage{endnotes}
\usepackage{graphicx}
\usepackage[center,bf]{caption}
\usepackage{morefloats}
\usepackage{epstopdf}
\usepackage{rotating}
\usepackage{enumerate}
\usepackage{bbm}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\numberwithin{equation}{section}
\usepackage{fancyhdr}
\setlength{\parindent}{24pt}
\setlength{\headheight}{0in}
\usepackage{longtable}
\usepackage{import}
\usepackage{natbib}
\setlength{\bibsep}{0pt plus 0.3ex}
\usepackage{microtype}
\usepackage{multirow}
\usepackage{adjustbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{verbatim}
\usepackage{setspace}
\linespread{1.3}
\usepackage{pdflscape}
\usepackage{subcaption}
\usetikzlibrary{arrows,calc}
\usepackage{setspace}
\usepackage{ragged2e}
%%%%%%%%%%% Suppress Warning
\usepackage{silence}
\WarningFilter{latex}{Text page}
\WarningFilter{natbib}{Citation}
\WarningFilter{natbib}{There}
\usepackage{changepage}
\newlength{\wideitemsep}
\setlength{\wideitemsep}{\itemsep}
\addtolength{\wideitemsep}{5pt}
\let\olditem\item
\renewcommand{\item}{\setlength{\itemsep}{7pt}\olditem}
\newcommand{\sym}[1]{{#1}}
\long\def/#1/{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Make Title appear in the top of the page
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{titling}
%\setlength{\droptitle}{-4em}
\setlength{\droptitle}{-2em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Directly brought from Lyx %%%%
\usepackage[T1]{fontenc}
\geometry{verbose,tmargin=2.7cm,bmargin=2.7cm,lmargin=2.5cm,rmargin=2.5cm}
\usepackage{amsthm}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
\theoremstyle{plain}
\newtheorem{prop}[thm]{\protect\propositionname}
\ifx\proof\undefined
\newenvironment{proof}[1][\protect\proofname]{\par
\normalfont\topsep6\p@@plus6\p@\relax
\trivlist
\itemindent\parindent
\item[\hskip\labelsep\scshape #1]\ignorespaces
}{%
\endtrivlist@endpefalse
}
\providecommand{\proofname}{Proof}
\fi
\theoremstyle{plain}
\newtheorem{cor}[thm]{\protect\corollaryname}
\makeatother
\usepackage{babel}
\providecommand{\corollaryname}{Corollary}
\providecommand{\propositionname}{Proposition}
\providecommand{\theoremname}{Theorem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This package makes you cross-reference across different tex files.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{xr-hyper}
\usepackage[colorlinks=true,urlcolor=blue, linkcolor=blue, citecolor=blue]{hyperref}
\hypersetup{
filecolor=black
}
\makeatletter
\newcommand*{\addFileDependency}[1]{
\typeout{(#1)}
@addtofilelist{#1}
\IfFileExists{#1}{}{\typeout{No file #1.}}
}
\makeatother
\newcommand*{\myexternaldocument}[1]{
\externaldocument{#1}
\addFileDependency{#1.tex}
\addFileDependency{#1.aux}
}
%%% END HELPER CODE
\myexternaldocument{online_appendix}
\begin{document}
\newpage{}
\setcounter{page}{1}
\section{Introduction}
\label{section:introduction}
Words\footnote{hi}
Citation examples:
\cite{Coase1992AER}
\newpage{}
\begin{singlespacing} %\nocite{*}
\bibliographystyle{aer}
\bibliography{Reference}
\end{singlespacing}
\end{document}
The reference I am using is
@article{Coase1992AER,
title={The Institutional Structure of Production},
author={Ronald H. Coase},
journal={American Economic Review},
volume={82},
number={4},
pages={713---719},
year={1992}
}
Then, what happens is I get two separate links.
I correctly get this
But if I hover my mouse over the author name, this link applies only to the author name
IF I hover my mouse over the year, this link applies only to the year part.
But the standard way to make hyperlink is to create one unified link across the author names and the year, correct? Then I want to follow the standard practice. How can I do that?
Addendum: The same material as before, but now in the form of a minimum working example or MWE:
\documentclass[11pt,english]{extarticle}
\begin{filecontents}[overwrite]{Reference.bib}
@article{Coase1992AER,
title ={The Institutional Structure of Production},
author ={Ronald H. Coase},
journal={American Economic Review},
volume ={82},
number ={4},
pages ={713-719},
year ={1992}
}
\end{filecontents}
\usepackage{natbib}
\bibliographystyle{aer}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[colorlinks=true,urlcolor=blue, linkcolor=blue,
citecolor=blue, filecolor=black]{hyperref}
\begin{document}
\cite{Coase1992AER}
\bibliography{Reference}
\end{document}




natbib, but inbiblatexthe author is usually not linked at all and linking it and the year in one go would make things significantly more fiddly in the implementation. ... – moewe Oct 02 '22 at 05:44natbib. If you cite a second work by the same author from a different year, say,\cite{Coase1992AER,Coase1993}gives you "Coase (1992, 1993)". It's not clear which source the name should link to here (granted, this may not be a strong argument in your book, as you could just pick one), but here linking in one go is not really possible as you have two works and you have to split the link somewhere to take your readers to both works. Frankly, I wouldn't bother. – moewe Oct 02 '22 at 05:46pages={713---719}, LaTeX will employ an em-dash as the connector between the page numbers. That's highly unusual, to put it mildly. Do consider changing the field topages={713--719}. – Mico Oct 02 '22 at 06:41