Latex 使用不同的背景色突出参考部分中的引用

Latex 使用不同的背景色突出参考部分中的引用,latex,pdflatex,biblatex,Latex,Pdflatex,Biblatex,我使用三种不同的背景色来突出我对三种不同类型的评论所做的编辑,这些评论是我提交给一家杂志的文章所收到的。我成功地突出了正文中的文本、引文和参考文献。然而,我没有成功地在参考资料部分突出引用。我想用文本中相同的背景色突出显示它们 \documentclass[journal]{IEEEtran} \ifCLASSINFOpdf \else \fi %\usepackage[left=0.5in, right=0.5in,top=0.1in,bottom=0.1in]{geometry} \usep

我使用三种不同的背景色来突出我对三种不同类型的评论所做的编辑,这些评论是我提交给一家杂志的文章所收到的。我成功地突出了正文中的文本、引文和参考文献。然而,我没有成功地在参考资料部分突出引用。我想用文本中相同的背景色突出显示它们

\documentclass[journal]{IEEEtran}
\ifCLASSINFOpdf
\else
\fi
%\usepackage[left=0.5in, right=0.5in,top=0.1in,bottom=0.1in]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage[skip=2pt,font=scriptsize]{caption} %\usepackage{caption}
\usepackage{subcaption}
\usepackage{array}
\usepackage{mdwmath}
\usepackage{mdwtab}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{siunitx}
%\usepackage{xcolor, soul}
%\sethlcolor{lightgray}
\usepackage{cancel}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
%\usetikzlibrary{calc,matrix}
\usepackage{color,soul}
\usepackage{cite}
\newtheorem{theorem}{Theorem}{}
\newtheorem{corollary}{Corollary}{}
\newtheorem{remark}{Remark}{}
\hyphenation{op-tical net-works semi-conduc-tor}
%% different color for different reviewer  \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
%\definecolor{r1}{r1!50}%{rgb}{0.8, 0.5, 0.2}
%\definecolor{r2}{rgb}{0.61, 0.87, 1}
%\definecolor{r3}{rgb}{1, 0.87, 0.8}
\newcommand{\Hl}[2][\empty]{%
    \ifx#1\empty
    \else
    \sethlcolor{#1}%
    \fi
    \hl{#2}}
%% Highlighting the citations and references as well using different background color
\soulregister\Hl{7}
\soulregister\cite7
\soulregister\ref7
\soulregister\pageref7
%% Highlighting citations in the Reference section using different background color
\usepackage{etoolbox}
\makeatletter 
\pretocmd\@bibitem{\csname keycolor#1\endcsname}{}{\fail}
\newcommand\citecolor[1]{\@namedef{keycolor#1}{\hspace*{-\labelwidth}\hspace*{-\labelsep}{\color{yellow}\rule[-0.3em]{\linewidth}{1\baselineskip}}\vspace*{\itemsep}\vspace*{-\baselineskip}}}
\makeatother
\citecolor{miguel14anestimator}
\begin{document}
I want to highlight \Hl[r1]{\cite{cite1}}, \Hl[r2]{\cite{cite2}} ,\Hl[r3]{\cite{cite3}} in Reference section using appropriate colors. 
\bibliography{BIBfile}{}
\bibliographystyle{IEEEtran}

\end{document}
我目前的产出: 以默认黄色高亮显示引用,也可以通过生成两个空格来高亮显示引用

我的引文存储在单独的bib文件中

@ARTICLE{cite1,
    author={M. {Carrasco} and F. {Mancilla-David} and R. {Ortega}},
    journal={IEEE Trans. Ind. Electron.},
    title={An Estimator of Solar Irradiance in Photovoltaic Arrays With Guaranteed Stability Properties},
    year={2014},
    volume={61},
    number={7},
    pages={3359-3366},}


@ONLINE{cite2,
    author={Licor},
    title={Pyranometer products specifications},
    year={2020},
    month={Apr.},
    url={https://www.licor.com/documents/3bjwy50xsb49jqof0wz4}
}

@article{cite3,
    title = "An assessment of series resistance estimation techniques for different silicon based SPV modules",
    journal = "Renewable and Sustainable Energy Reviews",
    volume = "98",
    pages = "199 - 216",
    year = "2018",
    author = "Rashmi Singh and Madhu Sharma and Rahul Rawat and Chandan Banerjee"
}

我在
\citecolor
中添加了一个可选参数,允许您指定每个bibitem有多少行

\documentclass[journal]{IEEEtran}
\ifCLASSINFOpdf
\else
\fi
%\usepackage[left=0.5in, right=0.5in,top=0.1in,bottom=0.1in]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage[skip=2pt,font=scriptsize]{caption} %\usepackage{caption}
\usepackage{subcaption}
\usepackage{array}
\usepackage{mdwmath}
\usepackage{mdwtab}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{siunitx}
%\usepackage{xcolor, soul}
%\sethlcolor{lightgray}
\usepackage{cancel}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
%\usetikzlibrary{calc,matrix}
\usepackage{color,soul}
\usepackage{cite}
\newtheorem{theorem}{Theorem}{}
\newtheorem{corollary}{Corollary}{}
\newtheorem{remark}{Remark}{}
\hyphenation{op-tical net-works semi-conduc-tor}
%% different color for different reviewer  \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
%\definecolor{r1}{r1!50}%{rgb}{0.8, 0.5, 0.2}
%\definecolor{r2}{rgb}{0.61, 0.87, 1}
%\definecolor{r3}{rgb}{1, 0.87, 0.8}
\newcommand{\Hl}[2][\empty]{%
    \ifx#1\empty
    \else
    \sethlcolor{#1}%
    \fi
    \hl{#2}}
%% Highlighting the citations and references as well using different background color
\soulregister\Hl{7}
\soulregister\cite7
\soulregister\ref7
\soulregister\pageref7
%% Highlighting citations in the Reference section using different background color
\usepackage{etoolbox}
\makeatletter 
\pretocmd\@bibitem{\csname keycolor#1\endcsname}{}{\fail}
\newcommand\citecolor[3][1]{\@namedef{keycolor#3}{\hspace*{-\labelwidth}\hspace*{-\labelsep}{\color{#2}\rule[-0.3em]{\dimexpr\linewidth+\labelwidth+\labelsep\relax}{#1\baselineskip}}\vspace*{\itemsep}\vspace*{-#1\baselineskip}}}
\makeatother

\citecolor[3]{r1}{cite1}
\citecolor[2]{r2}{cite2}
\citecolor[3]{r3}{cite3}

\begin{filecontents*}[overwrite]{\jobname.bib}

@article{einstein,
    author = {Einstein, A.},
    title = {Die Grundlage der allgemeinen Relativitätstheorie},
    journal = {Annalen der Physik},
    volume = {354},
    number = {7},
    doi = {10.1002/andp.19163540702},
    pages = {769--822},
    year = {1916}
}


@ARTICLE{cite1,
    author={M. {Carrasco} and F. {Mancilla-David} and R. {Ortega}},
    journal={IEEE Trans. Ind. Electron.},
    title={An Estimator of Solar Irradiance in Photovoltaic Arrays With Guaranteed Stability Properties},
    year={2014},
    volume={61},
    number={7},
    pages={3359-3366},}


@ONLINE{cite2,
    author={Licor},
    title={Pyranometer products specifications},
    year={2020},
    month={Apr.},
    url={https://www.licor.com/documents/3bjwy50xsb49jqof0wz4}
}

@article{cite3,
    title = "An assessment of series resistance estimation techniques for different silicon based SPV modules",
    journal = "Renewable and Sustainable Energy Reviews",
    volume = "98",
    pages = "199 - 216",
    year = "2018",
    author = "Rashmi Singh and Madhu Sharma and Rahul Rawat and Chandan Banerjee"
}
\end{filecontents*}

\begin{document}

normal cite: \cite{einstein}

I want to highlight \Hl[r1]{\cite{cite1}}, \Hl[r2]{\cite{cite2}} ,\Hl[r3]{\cite{cite3}} in Reference section using appropriate colors. 
\bibliography{\jobname}
\bibliographystyle{IEEEtran}

\end{document}

我建议您将问题转移到。此外,你确定即使在重新提交后,杂志也会接受所有这些彩色文本吗?@Eddymage是的!这是为了确认审查员的意见在论文中得到了处理。我见过有人用微软的word做这件事。它工作得非常好。我刚刚发现的另一件事是:我把这个
\citecolor[3]{r1}{cite1}\citecolor[2]{r2}{cite2}\citecolor[3]{r3}{cite3}
放在引文的后面,而不是序言中。对它确实奏效了。因此,我不必每次引用新的序言时都回到序言。