I use this to create a custom display of my references in my document:
\DeclareCiteCommand{\citehyperref}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifhyperref
{\hyperlink{\thefield{entrykey}}{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareFieldFormat[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\printnames{author}\addcolon\space\textit{#1}\isdot}
I have want I want: an hyperlink with "Last name, first name: title (date)". The only problem is that the hyperlink sens to the top of the document instead of the corresponding reference in the bibliography at the end of the document.
How can I solve this? Thanks in advance.
EDIT:
.tex file:
\documentclass[twoside,openright,12pt]{report}
\usepackage[a4paper,left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
% BIBLIOGRAPHY
%\usepackage{natbib} % première bibliographie
\usepackage{csquotes}
\usepackage[style=authoryear-icomp,autolang=hyphen]{biblatex}
\addbibresource{essai.bib}
\DeclareCiteCommand{\citehyperref}
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifhyperref
{\hyperlink{\thefield{entrykey}}{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\usebibmacro{title}\printtext[parens]{\printfield{year}}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareFieldFormat[article,book,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\printnames{author}\addcolon\space\textit{#1}\isdot}
\usepackage{setspace}
\usepackage[french]{babel}
\usepackage[pdftex]{graphicx}
\usepackage{float}
\usepackage{epigraph}
\begin{document}
This is a citation
\citehyperref{MY_REF}
\newpage
\newpage
\newpage
\addcontentsline{toc}{chapter}{Bibliographie}
\chaptermark{Bibliographie}
\printbibheading
\printbibliography
\end{document}
And this is my .bib file:
@book{MY_REF,
title = {TITLE},
isbn = {2-7578-2258-6},
pagetotal = {312},
publisher = {Points documents},
author = {XXX, YYY},
urldate = {2023-03-11},
date = {2011-04-21},
}
shepard_absolument_2011, but your example entry usesMY_REF. – Ulrike Fischer Apr 02 '23 at 12:32\printnames{author}into the\DeclareFieldFormatfeels a bit odd. (Not sure if it can cause actual trouble in standard use cases, but it definitely is not a standard idiom.) I couldn't find a question on here that discusses the exact style you want, but https://tex.stackexchange.com/q/547735/35864, https://tex.stackexchange.com/q/249762/35864, https://tex.stackexchange.com/q/540982/35864, https://tex.stackexchange.com/q/123104/35864 (note: the accepted answer is not best practice) are related and might be helpful. – moewe Apr 02 '23 at 16:02