![如何更改引用括号的颜色](https://linux22.com/image/279882/%E5%A6%82%E4%BD%95%E6%9B%B4%E6%94%B9%E5%BC%95%E7%94%A8%E6%8B%AC%E5%8F%B7%E7%9A%84%E9%A2%9C%E8%89%B2.png)
我想将引文括号的颜色从黑色改为蓝色。我曾使用
\usepackage{hyperref}
\usepackage{cite}
\renewcommand{\citeleft}{\textcolor{red}{[}}
\renewcommand{\citeright}{\textcolor{red}{]}}
但一切都是徒劳的。
\documentclass[preprint,3p,twocolumn]{elsarticle}
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
\usepackage{epstopdf}
\usepackage{lineno}
\usepackage{pifont}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage[nodots,nocompress]{numcompress}
\usepackage{setspace}
\usepackage{color}
\usepackage[pdfpagemode={UseOutlines},bookmarks=false,bookmarksopen=false,bookmarksopenlevel=0,
bookmarksnumbered=true,hypertexnames=true,colorlinks=true,linkcolor={blue},citecolor={blue}, urlcolor={blue},pdfstartview={FitH},unicode,breaklinks={true},citebordercolor={0 0 1}]{hyperref}
\biboptions{numbers,sort&compress,square,comma}
\journal{Computer Networks}
\begin{document}
\begin{frontmatter}
\title{Wireless Sensor Networks Routing: A Comprehensive Survey}
\author[a]{Palvinder Singh Mann\corref{cor1}}
\ead{[email protected]}
\author[b]{Satvir Singh}
\ead{[email protected]}
\cortext[cor1]{Corresponding author.Tel.:+91-9888395367 fax:+91-0181-2205852}
\address[a]{Department of Information Technology, DAV Institute of Engineering and Technology, Jalandhar,Punjab,India.144008.}
\address[b]{Department of Electronics and Communication Engineering, Saheed Bhagat Singh State Technical Campus, Ferozepur, Punjab, India.152004.}
\begin{abstract}
\end{abstract}
\begin{keyword}
\end{keyword}
\end{frontmatter}
\linenumbers
%% main text
\section{Introduction}
Wireless Sensor Networks (WSNs) contain self-configured,
distributed, autonomous and resource empowered sensor nodes
that monitor physical or environmental activities, such as
humidity, temperature, sound, vibration or pollutants in a
specific area of operation\cite{yick2008wireless}.
\subsection{Subsection One}
\section{References}
\bibliographystyle{model1-num-names}
\bibliography{Ref}
\end{document}
\documentclass[preprint,3p,twocolumn]{elsarticle}
\usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
\usepackage{epstopdf}
\usepackage{lineno}
\usepackage{pifont}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage[nodots,nocompress]{numcompress}
\usepackage{setspace}
\usepackage{color}
\usepackage[pdfpagemode={UseOutlines},bookmarks=false,bookmarksopen=false,bookmarksopenlevel=0,
bookmarksnumbered=true,hypertexnames=true,colorlinks=true,linkcolor={blue},citecolor={blue}, urlcolor={blue},pdfstartview={FitH},unicode,breaklinks={true},citebordercolor={0 0 1}]{hyperref}
\biboptions{numbers,sort&compress,square,comma}
\journal{Computer Networks}
\begin{document}
\begin{frontmatter}
\title{Wireless Sensor Networks Routing: A Comprehensive Survey}
\author[a]{Palvinder Singh Mann\corref{cor1}}
\ead{[email protected]}
\author[b]{Satvir Singh}
\ead{[email protected]}
\cortext[cor1]{Corresponding author.Tel.:+91-9888395367 fax:+91-0181-2205852}
\address[a]{Department of Information Technology, DAV Institute of Engineering and Technology, Jalandhar,Punjab,India.144008.}
\address[b]{Department of Electronics and Communication Engineering, Saheed Bhagat Singh State Technical Campus, Ferozepur, Punjab, India.152004.}
\begin{abstract}
\end{abstract}
\begin{keyword}
\end{keyword}
\end{frontmatter}
\linenumbers
%% main text
\section{Introduction}
Wireless Sensor Networks (WSNs) contain self-configured, distributed, autonomous and resource empowered sensor nodes that monitor physical or environmental activities, such as humidity, temperature, sound, vibration or pollutants in a specific area of operation\cite{yick2008wireless}.
\subsection{Subsection One}
\section{References}
\bibliographystyle{model1-num-names}
\bibliography{Ref}
\end{document}
答案1
有可能,但不推荐。
\documentclass{article}
\usepackage{etoolbox}
\usepackage[numbers,sort&compress,square,comma]{natbib}
\usepackage[colorlinks,citecolor=blue]{hyperref}
\makeatletter
\pretocmd{\NAT@open}{\begingroup\color{\@citecolor}}{}{}
\apptocmd{\NAT@close}{\endgroup}{}{}
\makeatother
\begin{document}
\cite{aristotle:physics}\par
\cite{companion,aristotle:physics}
\bibliographystyle{plain}
\bibliography{biblatex-examples}
\end{document}