From ac9797bcc483643cddb1d1b262a9634851c758c9 Mon Sep 17 00:00:00 2001 From: Jannis Born Date: Sun, 11 Sep 2022 15:53:39 +0200 Subject: [PATCH] Update bibliography-mimosis.tex --- bibliography-mimosis.tex | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/bibliography-mimosis.tex b/bibliography-mimosis.tex index 76834be..7195464 100644 --- a/bibliography-mimosis.tex +++ b/bibliography-mimosis.tex @@ -130,3 +130,34 @@ } \DeclareLanguageMapping{english}{english-mimosis} + +% This block produces clickable and colored author names whenever \textcite is used +\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}}}