I follow the answer provided on Answer for similar question
However, when I use that in Overleaf, if give out different output: Suppose:
Smith (1992 & 1993)
end up giving:
\documentclass[12pt,oneside]{book} % Remove draft option to show figures (for final draft), otherwise keep for faster production
\usepackage{enumitem} % macros to modify appearance of 'itemize' environments
\usepackage{uorthesis} % Loads the LaTeX style package
\usepackage[
% backend=biber,
% style=authoryear,
style=authoryear-comp,
% citestyle=authoryear,
dashed=false,
maxcitenames=2,
maxbibnames=99,
giveninits,
uniquename=init]{biblatex}
\DeclareNameAlias{sortname}{family-given} %for second and third author name
\addbibresource{references.bib}
\usepackage{uorbib}
% for combine both year for an author
\renewcommand{\compcitedelim}{\space\&\space}
% for references 's studies (year)
\renewcommand*{\nameyeardelim}{\addcomma\space}
\newcommand{\mycite}[1]{\citeauthor{#1}'s \citeyear{#1}}
\DeclareCiteCommand{\citeauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printtext[bibhyperref]{\printnames{labelname}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\citeyear} % <======================================
{}
{(\bibhyperref{\printdate})}
{\multicitedelim}
{}
\DeclareCiteCommand{\parencite}[\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{\usebibmacro{cite}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\makeatletter
\let\abx@macro@textciteOrig\abx@macro@textcite
\renewbibmacro{textcite}{% <============================================
\bibhyperref{%
\let\bibhyperref\relax\relax%
\abx@macro@textciteOrig%
}%
}%
\makeatother
% for references 's studies (year)
\usepackage{enumitem} %for tab in Latex (macros to modify appearance of 'itemize' environments)
% Put custom packages to be loaded here
% \usepackage{linguex} % For linguistic examples
% \usepackage{tikz} % For drawing
%for section paragraph
% https://tex.stackexchange.com/questions/60209/how-to-add-an-extra-level-of-sections-with-headings-below-subsubsection
\makeatletter
%%%%% Change the style of paragraph headings %%%%%
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% %for section paragraph
{-2.5ex\@plus -1ex \@minus -.25ex}% %for section paragraph
{1.25ex \@plus .25ex}% %for section paragraph
{\normalfont\normalsize\bfseries}} %for section paragraph
%%%%% Change the style of subparagraph headings %%%%%
\renewcommand\subparagraph{\@startsection{paragraph}{4}{\z@}% %for section paragraph
{-2.5ex\@plus -1ex \@minus -.25ex}% %for section paragraph
{1.25ex \@plus .25ex}% %for section paragraph
{\normalfont\normalsize\bfseries}} %for section paragraph
\makeatother
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
%for paragraph spacing
\setlength{\parindent}{4em} %for paragraph spacing
\setlength{\parskip}{1em} %for paragraph spacing
%for paragraph spacing
%for table spacing to second row
\usepackage{tabularx,seqsplit, caption} %for table spacing to second row
\usepackage{booktabs, ragged2e} % Use booktabs rules and get rid of vertical rules, ragged2e to ragged text
\usepackage{makecell,siunitx} %for table spacing to second row
%for table spacing to second row
\usepackage{threeparttable} %to add footnote below table
\renewcommand{\TPTtagStyle}{\itshape} % optional
\usepackage{lipsum} % for filler text
% for bold in table using \small
\usepackage{makecell} % for bold in table using \small
\renewcommand\theadfont{\small\bfseries} % for bold in table using \small
\usepackage{tabulary,siunitx}
% for bold in table using \small
\renewcommand\theadgape{}
\usepackage{graphicx}
\usepackage{libertine} %added by ryan
%\usepackage{float}
%\restylefloat{table}
%for table multirow
%\usepackage{multirow} %for table multirow
%\usepackage{multicol} %for table multirow
\usepackage{makecell, multirow, tabularx} %for table multirow
%for table multirow
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc, positioning,matrix,fit,calc, arrows.meta,
backgrounds,
chains}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15} % <---
%---------------- show page layout. don't use in a real document!
% \usepackage{showframe}
% \renewcommand\ShowFrameLinethickness{0.15pt}
% \renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
% for making a comma after the volumn
\renewbibmacro*{volume+number+eid}{%
\setunit{\addcomma\space}%
\printfield{volume}%
\setunit*{\adddot}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
% \usepackage{parskip}
\usepackage[hypcap=false]{caption}
\begin{document}
% Title page
\include{structure/title}
% All subsequent pages must be numbered, title page is considered page i,
% front matter is numbered in lowercase Roman numerals
\pagestyle{fancy}
\pagenumbering{roman}
\setcounter{page}{2}
\doublespacing
% Dedication (optional)
\include{structure/dedication}
% Acknowledgments
\include{structure/acknowledgements}
% Abstract
\include{structure/abstract}
% Table of Contents, List of Tables, List of Figures
\tableofcontents
%List of Tables & Figures
\include{structure/tablesfigures}
%%%%%%%%%%%%%%%%%%%% DISSERTATION CONTENT %%%%%%%%%%%%%%%%%%%%
% Regular numbering starts now, first page of first chapter is page 1
\clearpage
\setcounter{page}{0}
\pagenumbering{arabic}
% Body
Test writing \textcite{flowers1992ear, flowers1993sound} and \textcite{peres2003sonification} studies.
\\
Follow-up in \textcite{flowers1993sound}, blablabla
% References
\clearpage
\addcontentsline{toc}{chapter}{Bibliography}
\markboth{\MakeUppercase{Bibliography}}{}
%\singlespacing
\printbibliography
\appendix
\include{chapters/99-appendix}
\end{document}
Added in uorbib.sty file:
% This contains styling elements for bibliography
% stuff: Entire citation is colored instead of just
% year.
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{uorbib}
[2018/01/18 v0.01 LaTeX package for UOR thesis]
%% Bib stuff
\DeclareFieldFormat{citehyperref}{%
\DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
\bibhyperref{#1}}
\DeclareFieldFormat{textcitehyperref}{%
\DeclareFieldAlias{bibhyperref}{noformat}% Avoid nested links
\bibhyperref{%
#1%
\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}}}
\savebibmacro{cite}
\savebibmacro{textcite}
\renewbibmacro*{cite}{%
\printtext[citehyperref]{%
\restorebibmacro{cite}%
\usebibmacro{cite}}}
\renewbibmacro*{textcite}{%
\ifboolexpr{
( not test {\iffieldundef{prenote}} and
test {\ifnumequal{\value{citecount}}{1}} )
or
( not test {\iffieldundef{postnote}} and
test {\ifnumequal{\value{citecount}}{\value{citetotal}}} )
}
{\DeclareFieldAlias{textcitehyperref}{noformat}}
{}%
\printtext[textcitehyperref]{%
\restorebibmacro{textcite}%
\usebibmacro{textcite}}}
\endinput
%%
%% End of file `uorbib.sty'.
Added in uorthesis.sty file:
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{uorthesis}
[2018/01/18 v0.01 LaTeX package for UOR thesis]
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{enumitem}
\setlist{nosep} % Removes too much vertical spacing in lists
\usepackage{booktabs} % makes tables look good
\usepackage{fancyhdr} % For page number in the upper right (required) and other running headers(optional)
\usepackage{setspace} % For double-spacing (required)
\usepackage{titlesec} % For keeping chapter/chapter titles single-spaced
\usepackage{etoolbox} % For the flag determining if front matter goes into the TOC
\usepackage{float} % Helps float images to the top
\RequirePackage{xcolor}
% Define custom colors
\definecolor{darkblue}{rgb}{0, 0, 0.5}
\usepackage[colorlinks=true, allcolors=darkblue]{hyperref} % Adds hyperlinks in the pdf
\usepackage{csquotes} % Makes quotes look good
\usepackage[font=small,labelfont={bf,sf}, textfont={sf}, justification=centering]{caption}
%% Font setup
\usepackage{mathptmx}
% \usepackage{lmodern}
\usepackage{helvet}
% Header height (to avoid fancyhdr error)
\setlength{\headheight}{13.6pt}
% Header formatting for regular pages
\fancyhf{}
\fancyhead[L]{\it\small\leftmark}
\fancyhead[R]{\small\thepage}
% Header formatting for chapter title pages
\fancypagestyle{plain}{%
\fancyhf{}
\fancyhead[R]{\small\thepage}
\renewcommand{\headrulewidth}{0pt}
}
% Formatting of chapter and chapter titles: keep them single-spaced in the midst of double-spaced text
\usepackage{sectsty}
\titleformat{\chapter}[hang]{\Huge\sffamily\bfseries}{\thechapter{. }}{0pt}{\Huge}
\allsectionsfont{\normalfont\sffamily\bfseries}
\usepackage{subfigure}
\usepackage[subfigure]{tocloft} % subfigure option only if using subfigure package
\renewcommand{\cfttoctitlefont}{\Huge \bfseries \sffamily} % ToC title
\addto\captionsenglish{
\renewcommand{\listfigurename}{\textsf{List of Figures}}
\renewcommand{\listtablename}{\textsf{List of Tables}}
}
% Flag for whether to add front matter to TOC
\newtoggle{fulltoc}
\toggletrue{fulltoc} % Change to \togglefalse{fulltoc} to remove front matter
\renewcommand{\contentsname}{Table of Contents}
\endinput
%%
%% End of file `uorthesis.sty'.


uorbib.stywhich contain the\renewbibmacro*{textcite},\DeclareFieldFormat{textcitehyperref}{%. I hope it will not caused a problem in later on. – aan Sep 13 '19 at 03:11textcitemacro inauthoryear-comp.cbxis different from inauthoryear.cbx. If you are changing it, you'll need to account for these differences. – David Purton Sep 13 '19 at 03:34style=authoryear-comp, I do not useauthoryear? – aan Sep 13 '19 at 12:12authoryear-comphas extra features to compress the year. This makes its citation macros more complex thanauthoryear. You can compare the files to see the differences. Compareauthoryear.cbxwithauthoryear-comp.cbxto see the differences in code. But you'll notice thatauthoryear-comp.bbxjust inputsauthoryear.bbxwithout changes, so the two styles have exactly the same output in the bibliography. – David Purton Sep 13 '19 at 14:07