My question is closely related to Customize backref similar to Wikipedia.
I am trying to obtain the same result but with the authoryear citestyle instead. This give me the following warning: Macro 'cite:comp' undefined. And as a result when I click on the arrow in the reference section the hyperlink does not work. The code I am using is:
\documentclass[12pt]{article}
\usepackage{polyglossia}
\setdefaultlanguage{french}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[backend=biber,
style=numeric-comp,
citestyle=authoryear,
sorting=nty,
natbib=true
]{biblatex}
\usepackage[xetex]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@article{georgescu1971,
title={The entropy law and the economic problem},
author={Georgescu-Roegen, Nicholas},
journal={Harvard University, Harvard},
year={1971}
}
\end{filecontents}
\addbibresource{biblio.bib}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\DeclareFieldFormat{bibhypertarget}{%
\bibhypertarget{cbx:instcount:\the\value{instcount}}{#1}}
\def\abx@aux@wikibackref#1#2#3{%
\listcsgadd{cbx@wikibackref@#1@#2}{#3}}
\def\blx@addwikibackref#1{%
\if@filesw
\protected@write\@mainaux{}{\string\abx@aux@wikibackref
{\the\c@refsection}{#1}{\the\value{instcount}}}%
\fi}
\def\blx@instcount@label{%
\label{cbx@instcount@\the\value{instcount}}}
\AtEveryCitekey{%
\blx@addwikibackref{\thefield{entrykey}}%
\blx@instcount@label
}
\renewbibmacro*{cite:comp}{%
\addtocounter{cbx@tempcntb}{1}%
\printtext[bibhypertarget]{%
\iffieldundef{shorthand}
{\ifbool{bbx:subentry}
{\iffieldundef{entrysetcount}
{\usebibmacro{cite:comp:comp}}
{\usebibmacro{cite:comp:inset}}}
{\usebibmacro{cite:comp:comp}}}
{\usebibmacro{cite:comp:shand}}}}
\renewbibmacro*{begentry}{\usebibmacro{wikipageref}}
\newcounter{wikibackrefitemcount}
\renewcommand{\thewikibackrefitemcount}{\alph{wikibackrefitemcount}}
\newbibmacro*{wikipageref}{%
\ifcsundef{cbx@wikibackref@\the\c@refsection @\thefield{entrykey}}
{}
{\setcounter{wikibackrefitemcount}{0}%
\renewcommand*{\do}[1]{\stepcounter{wikibackrefitemcount}}%
\dolistcsloop{cbx@wikibackref@\the\c@refsection @\thefield{entrykey}}%
\ifnumgreater{\value{wikibackrefitemcount}}{1}
{\setcounter{wikibackrefitemcount}{0}%
\renewcommand*{\do}[1]{%
\stepcounter{wikibackrefitemcount}%
\mkbibsuperscript{%
\bibhyperlink{cbx:instcount:##1}{\thewikibackrefitemcount}\addspace}}%
$\uparrow$\addspace\dolistcsloop{cbx@wikibackref@\the\c@refsection @\thefield{entrykey}}}
{\renewcommand*{\do}[1]{\bibhyperlink{cbx:instcount:##1}{$\uparrow$}\addspace}%
\dolistcsloop{cbx@wikibackref@\the\c@refsection @\thefield{entrykey}}}}}
\makeatother
\begin{document}
The book \emph{The Enthropy Law and the Economic Process} \citep{georgescu1971} is very important to understand the theory of economic degrowth.
\newpage
\printbibliography
\end{document}
Thank you in advance for your help.
style=numeric-comp, citestyle=authoryear, sorting=nty,is quite a weird combination. Do you really want a bibliography with numbers, citations in author-year format and sorting as name > title > year. The numbering in the bibliography is kind of pointless when citations are given as author-year because the label numbers are never used. The sorting that prioritises title over year does not lend itself to your citation style that prioritises the year. Since the year is not as prominent in a numeric bib style, finding the right citation can be complicated. – moewe Nov 21 '17 at 19:49