颜色引用编号

颜色引用编号

有没有办法给打印参考书目的引文相关的数字着色?(例如,我想要12在参考部分中用红色表示。)

以下是 MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{Aldstadt2010,
  address = {Berlin, Heidelberg},
  author = {Aldstadt, Jared},
  doi = {10.1007/978-3-642-03647-7},
  editor = {Fischer, Manfred M. and Getis, Arthur}
  file = {:home/persican/.local/share/data/Mendeley Ltd./Mendeley Desktop/Downloaded/Aldstadt - 2010 - Handbook of Applied Spatial Analysis.pdf:pdf},
  isbn = {978-3-642-03646-0},
  pages = {279--300},
  publisher = {Springer Berlin Heidelberg}
  title = {{Handbook of Applied Spatial Analysis}},
  url = {http://link.springer.com/10.1007/978-3-642-03647-7},
  year = {2010}
}

@article{Aksnes1993,
  author = {Aksnes, D and Giske, J},
  doi = {10.1016/0304-3800(93)90007-F},
  issn = {03043800},
  journal = {Ecological Modelling},
  pages = {233--250},
  title = {{A theoretical model of aquatic visual feeding}},
  volume = {67},
  year = {1993}
}
\end{filecontents*}


\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{enumitem}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
  \definecolor{refcol}{rgb}{0.1921569 0.5098039 0.7411765}
\usepackage{hyperref}
  \hypersetup{
     colorlinks   = true,
     citecolor    = BrickRed,
     linkcolor = BrickRed,
     urlcolor = refcol
  }
\usepackage[%
  autocite    = superscript,
  backend     = bibtex,
  sortcites   = true,
  %style       = numeric,
  backref     = false,
  url         = false,
  isbn        = false,
  doi         = false,
  firstinits  = true,
  style       = science,
]{biblatex}
  \addbibresource{\jobname.bib}

\defbibenvironment{bibliography}
  {\noindent}
  {\unspace}
  {\printtext[labelnumberwidth]{%
   \printfield{prefixnumber}%
   \printfield{labelnumber}}
   \addspace}
\renewbibmacro*{finentry}{\finentry\addspace}
\DeclareLanguageMapping{english}{english-apa}
\renewcommand*{\bibfont}{\scriptsize}

\begin{document}
  \section*{Introduction}
  This is a citation \autocite{Aldstadt2010, Aksnes1993}.

  \begin{spacing}{.5}
  \printbibliography
  \end{spacing}
  \end{document}

答案1

这是一个棘手的方法。

您已经在样本文档中使用了以下代码,只需尝试\textcolor{red}按以下示例添加:

\defbibenvironment{bibliography}
 {\noindent}
  {\unspace}
  {\printtext[labelnumberwidth]{%
   \printfield{prefixnumber}%
   \textcolor{red}{\printfield{labelnumber}}}
   \addspace}

相关内容