Ich verwende den folgenden Code, um die Klammern der Referenzen in meinem Text einzufärben. Das funktioniert auch gut für die Kommas und Bindestriche zwischen den Klammern. Allerdings werden auch die Farben der nachfolgenden Satzzeichen geändert. Gibt es eine Lösung, damit diese Satzzeichen in der Standardtextfarbe erscheinen?
Bitte beachten Sie, dass Sie zum Kompilieren des folgenden Beispiels möglicherweise Ihr Standard-Bibliografietool auf Biber ändern müssen.
\documentclass[a4paper,twoside,openright,chapterprefix=true,11pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[doi=false,url=true,isbn=false,sorting=none,style=numeric-comp,bibencoding=utf8,babel=other,backend=biber]{biblatex}
\usepackage[utf8]{inputenc}
\usepackage[ngerman,american]{babel}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{CeruleanRef}{RGB}{12,127,172}
\usepackage[colorlinks=true, citecolor=CeruleanRef]{hyperref}
\begin{filecontents}{bibname.bib}
@book{Lehner2014,
author = {Lehner, Markus and Tichler, Robert and Koppe, Markus},
doi = {10.1007/978-3-319-03995-4},
file = {:Users/lima/ICP/Literatur/Power-to-Gas- Technology and Business Models.pdf:pdf},
isbn = {978-3-319-03994-7},
title = {{Power-to-Gas: Technology and Business Models}},
year = {2014}
}
@article{Garcia2014,
author = {Garcia-Fresnillo, L. and Shemet, V. and Chyrkin, A. and de Haart, L.G.J. and Quadakkers, W.J.},
doi = {10.1016/j.jpowsour.2014.07.189},
file = {:Users/lima/Library/Application Support/Mendeley Desktop/Downloaded/Garcia-Fresnillo et al. - 2014 - Long-term behaviour of solid oxide fuel cell interconnect materials in contact with Ni-mesh during e(2).pdf:pdf},
issn = {03787753},
journal = {J. Power Sources},
month = dec,
pages = {213--222},
publisher = {Elsevier B.V},
title = {{Long-term behaviour of solid oxide fuel cell interconnect materials in contact with Ni-mesh during exposure in simulated anode gas at 700 and 800}},
url = {http://linkinghub.elsevier.com/retrieve/pii/S0378775314012531},
volume = {271},
year = {2014}
}
\end{filecontents}
\bibliography{bibname.bib}
\DeclareCiteCommand{\cite}[\color{CeruleanRef}\mkbibbrackets]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}}
\begin{document}
test
\cite{Lehner2014} and \cite{Garcia2014} but \cite{Lehner2014}. Or \cite{Lehner2014,Garcia2014}, which has
\end{document}
Antwort1
Sie können Ihren eigenen Klammerbefehl definieren (oder \mkbibbrackets neu definieren):
\makeatletter
\newrobustcmd{\mkbibbracketscolor}[1]{%
\begingroup%
\blx@blxinit
\blx@setsfcodes
\color{CeruleanRef}\bibopenbracket#1\bibclosebracket%
\endgroup}
\makeatother
\DeclareCiteCommand{\cite}[\mkbibbracketscolor]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite:comp}}
{}
{\usebibmacro{cite:dump}%
\usebibmacro{postnote}}