0

Consider the following MWE, with this .tex file:

\documentclass[]{article}

% PACKAGES

\usepackage[isbn=false,giveninits=true,uniquename=init,style=authoryear-comp,backend=biber,sorting=ynt,natbib,maxbibnames=99,maxcitenames=99,hyperref=true,sortcites=true,language=british,backref=true,url=false,doi=false]{biblatex} % To get fancy bibliography.

% HYPERREF SETTINGS

\usepackage[colorlinks=true,urlcolor=blue,linkcolor=black]{hyperref} \usepackage[nameinlink]{cleveref} \hypersetup{allcolors=blue}

% REDEFINING CITEYEAR

\DeclareCiteCommand{\citeyear} {} {\bibhyperref{\printfield{year}}} {\multicitedelim} {}

\DeclareCiteCommand{\citeyearpar} {} {\mkbibparens{\bibhyperref{\printfield{year}}}} {\multicitedelim} {}

\addbibresource{References.bib}

\begin{document}

\citeauthor{author_yy}'s \citeyearpar[Axiom X, p. y]{author_yy}.

\printbibliography[heading=bibintoc]

\end{document}

And this .bib file:

@article{author_yy,
    title = {title},
    author = {author},
    journal = {journal},
    volume = {1},
    number = {1},
    pages = {yyy--xxx},
    year = {2000},
    doi = {XXXXXXXXXX}
}

As you can see in the output below, the bit [Axiom X, p. y] is lost due to my redefinitions of \citeyear and \citeyearpar. My goal is to get a clickable year while keeping the bit [Axiom X, p. y] in the output. Can you help me achieve that?

enter image description here

moewe
  • 175,683
EoDmnFOr3q
  • 2,299
  • 2
    Have a look at https://tex.stackexchange.com/q/22273/35864 (the accepted answer is outdated, though, check the other answers as well). – moewe Feb 23 '23 at 21:59
  • Thank you for your comment. I tried the MWE in your answer and it works. But unfortunately, I must be doing something in my preamble that prevents your solution from working in my actual document. So, I am still where I was… – EoDmnFOr3q Feb 23 '23 at 23:14

1 Answers1

0

The solution turned out to be much easier than anticipated. Just use:

\citeauthor{author_yy}’s (Axiom X, p. y, \citeyear{author_yy})

That will do.

EoDmnFOr3q
  • 2,299
  • 1
    The problem with \citeyear is that is just shows the year. If you need extradate, because you have two works by the same authors from the same year, the letter is not shown. Try citing both knuth:ct:b and knuth:ct:c from biblatex-examples.bib. – moewe Feb 24 '23 at 05:02