후속 문장 부호의 색상

후속 문장 부호의 색상

내 텍스트에서 참조의 괄호를 색칠하기 위해 다음 코드를 사용합니다. 이는 대괄호 사이의 쉼표와 하이픈에도 잘 작동합니다. 그러나 후속 구두점의 색상도 변경됩니다. 이러한 구두점을 표준 텍스트 색상으로 표시하는 해결 방법이 있습니까?

아래 예제를 컴파일하려면 기본 참고문헌 도구를 Biber로 변경해야 할 수도 있습니다.

\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}

여기에 이미지 설명을 입력하세요

답변1

자신만의 대괄호 명령을 정의하거나 \mkbibbrackets를 재정의할 수 있습니다.

\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}}

관련 정보