Die Farbe des Zitat-Hyperlinks ist je nach Zitatschlüssel unterschiedlich

Die Farbe des Zitat-Hyperlinks ist je nach Zitatschlüssel unterschiedlich

Ich schreibe gerade meine Doktorarbeit und habe es geschafft, sowohl eine Bibliographie als auch meine Publikationsliste mit Biber und Biblatex darin aufzunehmen. Ich dachte, es wäre interessant, hervorzuheben, wenn eine meiner Publikationen in der Arbeit zitiert wird, indem ich die \cite{...}-Nummer für sie unterschiedlich einfärbe. Ich möchte zum Beispiel, dass die Ausgabe für \cite{Amariti:2023hev} orange statt grün ist.

Der grundlegende Aufbau der Arbeit ist wie folgt

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{xcolor}
\definecolor{newred}{rgb}{0.8, 0.0, 0.0}
\definecolor{ao}{rgb}{0.0, 0.5, 0.0}

\usepackage{hyperref}
\hypersetup{
    colorlinks = true,
    linkcolor= newred,
    citecolor= ao,
    linktoc=page
} 
\usepackage[backend=biber, style=authoryear]{biblatex}

\DeclareSourcemap{
  \maps[datatype=bibtex, overwrite]{
    \map{
      \perdatasource{bib1.bib}
      \step[fieldset=keywords, fieldvalue={, }, appendstrict]
      \step[fieldset=keywords, fieldvalue=one, append]
    }
    \map{
      \perdatasource{bib2.bib}
      \step[fieldset=keywords, fieldvalue={, }, appendstrict]
      \step[fieldset=keywords, fieldvalue=two, append]
    }
  }
}

\begin{filecontents}{bib1.bib}
@article{Amariti:2023hev,
    author = "Amariti, Antonio and Morgante, Davide and Pasternak, Antoine and Rota, Simone and Tatitscheff, Valdo",
    title = "{One-form symmetries in $\mathcal{N} = 3$ S-folds}",
    eprint = "2303.07299",
    archivePrefix = "arXiv",
    primaryClass = "hep-th",
    doi = "10.21468/SciPostPhys.15.4.132",
    journal = "SciPost Phys.",
    volume = "15",
    number = "4",
    pages = "132",
    year = "2023"
}
}
\end{filecontents}
\begin{filecontents}{bib2.bib}
@article{Gaiotto:2012xa,
    author = "Gaiotto, Davide and Rastelli, Leonardo and Razamat, Shlomo S.",
    title = "{Bootstrapping the superconformal index with surface defects}",
    eprint = "1207.3577",
    archivePrefix = "arXiv",
    primaryClass = "hep-th",
    doi = "10.1007/JHEP01(2013)022",
    journal = "JHEP",
    volume = "01",
    pages = "022",
    year = "2013"
}
\end{filecontents}
\addbibresource{bib1.bib}
\addbibresource{bib2.bib}

\begin{document}
I want the color of \cite{Gaiotto:2012xa} from bib2 to be the default (green) and the one of \cite{Amariti:2023hev} from bib1 to be another color like orange.

\printbibliography[title={First Bibliography}, keyword=one]
\printbibliography[title={Second Bibliography}, keyword=two]
\end{document}

Darüber hinaus möchte ich nicht für die wenigen, über die ganze Arbeit verstreuten Zitate einen eigenen \cite-Befehl definieren.

Wäre so etwas möglich?

Antwort1

Sie können

\AtEveryCitekey{\ifkeyword{two}
     {\hypersetup{citecolor=ao}}
     {\hypersetup{citecolor=orange}}}

Bildbeschreibung hier eingeben

verwandte Informationen