2

I am using the

\newcommand{\mycite}[2]{\citeauthor{kazem2003design}'s \citeyear{kazem2003design}}

However, the cross-referencing for the author is not working. For the year is working.

Outcome: enter image description here

In here According to Kazem et al.’s studies (2003), blablabla

  1. Kazem et al cross-referencing is not working.
  2. (2003) cross-referencing is working (it change to blue colour text)

Code:

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\DeclareNameAlias{sortname}{family-given}


\addbibresource{biblatex-examples.bib}

\begin{document}

According to \citeauthor{kazem2003design}'s studies \autocite*{kazem2003design}, blablabla 

\printbibliography
\end{document}

Reference:

@inproceedings{kazem2003design,
  title={Design considerations for a background auditory display to aid pilot situation awareness},
  author={Kazem, Mandana LN and Noyes, Janet M and Lieven, Nicholas J},
  year={2003},
  organization={Georgia Institute of Technology}
}
  • "is not working" is not realy helpful! I'm sure you know what is not working but we do not have your informations! Can you please explain better? Do you want it also in blue? BTW: please add the call of package hyperref to your code so that we can see the color too on our computers ... – Mensch Aug 21 at 1:04
  • @Mensch, thanks. I want the Author name to become blue like the year. so that when I click on it, it direct to the referencing. – aan Aug 21 at 1:07
2

Well, you have some errors in your given code I corrected in the following MWE.

To solve your issue add the code

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printtext[bibhyperref]{\printnames{labelname}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

to your preamble.

With the following complete MWE

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{kazem2003design,
  title={Design considerations for a background auditory display to aid pilot situation awareness},
  author={Kazem, Mandana LN and Noyes, Janet M and Lieven, Nicholas J},
  year={2003},
  organization={Georgia Institute of Technology}
}
\end{filecontents}


\documentclass[british]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\usepackage{csquotes}
\usepackage[%
  style=authoryear, 
  backend=biber, 
  giveninits % <========================================================
]{biblatex}
\addbibresource{\jobname.bib} % \jobname to use the bib file created with filecontents
\DeclareNameAlias{sortname}{family-given}

\usepackage[unicode,colorlinks,citecolor=blue]{hyperref} % <============

\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}}


\begin{document}

According to \citeauthor{kazem2003design}'s studies \autocite*{kazem2003design}, blablabla 

\mycite{kazem2003design} % <============================================

\printbibliography
\end{document}

you get the following result:

resulting pdf

Please see that \citeyear has no link in my added corrected command \mycite!

  • thanks. There will be two issues. 1. Will it create all the author name appear in bibliography rather than using Harvard referencing where the first name is getting short. 2. It does not change to blue color as in cross-referencing that link to citition. – aan Aug 21 at 6:54
  • 2
    To get the blue color use command \usepackage[unicode,colorlinks,citecolor=blue]{hyperref} in the preamble. See updated answer. I'm not sure if uncommenting giveninits gives you the harvard style you want (you did not explain in your question exactly what you want) but then take care of the resulting warning ... – Mensch Aug 21 at 7:13
  • 1
    thanks. If I use \textcite and \parencite, it only link the year and not both author and year. Is there other format? – aan Aug 21 at 11:30
  • 1
    @aan We do not like "living" questions (expanded or completly changed questions in comments) here. Your comment above is a new question, please ask a new question therefore! My answer here answered your given question ... ... – Mensch Aug 21 at 18:37

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.