如何更改引用括号的颜色

如何更改引用括号的颜色

我想将引文括号的颜色从黑色改为蓝色。我曾使用

\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

有可能,但不推荐。

psmaan引用边界

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

相关内容