我写信给您是因为我没有在这个网站或其他网站上找到这个问题的解决方案或答案。具体来说,我对我的引文颜色感到困扰,无论我做了什么更改,它都固定为蓝色(例如这里;尽管例如 citecolor=red,但我的所有引文都是蓝色的)。我想知道这是否与导入的包有关,所以这里是测试代码。
\documentclass[9pt,authoryear]{elsarticle}
\journal{Journal of Resources, Conservation \& Recycling} % Submitted to journal...
% Symbols and language
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{textcomp}
\usepackage{eurosym}
% Geometry
\usepackage{multicol}
\usepackage[left=1.2cm,right=1.2cm,top=1.5cm,bottom=1.5cm]{geometry}
\usepackage{parskip}
\setlength{\parskip}{0.5em}
\usepackage{lscape}
% Math packages
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{dsfont}
\usepackage{lmodern}
\usepackage{mathtools, stmaryrd}
\usepackage{xparse}
\numberwithin{equation}{section}
\DeclarePairedDelimiterX{\Iintv}[1]{\llbracket}{\rrbracket}{\iintvargs{#1}}
\NewDocumentCommand{\iintvargs}{>{\SplitArgument{1}{,}}m}{\iintvargsaux#1} %
\NewDocumentCommand{\iintvargsaux}{mm} {#1\mkern1.5mu..\mkern1.5mu#2}
% Figure and tables package
\usepackage{epsfig}
\usepackage{placeins}
\usepackage{multirow,array}
\usepackage{booktabs}
\usepackage[font={footnotesize},labelfont={bf,footnotesize}]{caption}
\usepackage{subcaption}
\usepackage{makecell}
\usepackage{longtable}
\usepackage{fourier}
\usepackage{floatrow}
\usepackage{float}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}
\DeclareUnicodeCharacter{2212}{-}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
% Enumerate package
\usepackage{enumerate}
\usepackage{enumitem}
% Color packages
\usepackage{xcolor}
% Hyper-references packages
\usepackage{url}
\usepackage[bookmarks=false, bookmarksnumbered=true,colorlinks=true,setpagesize=false, bookmarkstype=toc, urlcolor=blue, citecolor=red, linkcolor=black, filecolor=blue]{hyperref}
\let\OLDthebibliography\thebibliography
\renewcommand\thebibliography[1]{
\OLDthebibliography{#1}
\setlength{\parskip}{0pt}
\setlength{\itemsep}{0pt plus 0.3ex}
}
% Bibliography
\usepackage{natbib}
\bibliographystyle{agsm}
\begin{document}
\citep{author} shall be red.
\bibliography{biblio.bib}
\end{document}
感谢您的帮助 :)
答案1
您的班级正在重新定义颜色\begin{document}
。使用 \hypersetup 再次覆盖此内容:
\documentclass[9pt,authoryear]{elsarticle}
\usepackage{xcolor}
\usepackage{natbib}
\usepackage[colorlinks]{hyperref}
\AtBeginDocument{\hypersetup{citecolor=red}} %force red
\bibliographystyle{agsm}
\begin{document}
\citep{doody} shall be red.
\bibliography{biblatex-examples}
\end{document}