乳胶突出显示 \citation 和 \ref 使用不同的背景颜色
Latex highlighting \citation and \ref using different backgrond colors
您好,我正在写一篇修改后的文章。我用不同的背景颜色突出显示修订文本的背景。我成功地突出了它们,但我无法突出显示底部参考文献中的引文。
\documentclass[journal]{IEEEtran}
\ifCLASSINFOpdf
\else
\fi
%% Following for different color highlight using \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
\newcommand{\Hl}[2][\empty]{%
\ifx#1\empty
\else
\sethlcolor{#1}%
\fi
\hl{#2}}
\usepackage{soul,color}
\soulregister\Hl{7}
\soulregister\ref7
\soulregister\pageref7
\begin{document}
\Hl[r2]{I wanted to highlight this \cite{miguel14anestimator}. It was
successful highlighted in the main text. But the problem is it was not
highlighted in the Bottom References?}
@ARTICLE{miguel14anestimator,
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},}
\end{document}
\ref
已经使用您的代码开箱即用。要使 \cite
也兼容,您可以添加 \soulregister\cite7
\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}
%% Following for different color highlight using \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
\newcommand{\Hl}[2][\empty]{%
\ifx#1\empty
\else
\sethlcolor{#1}%
\fi
\hl{#2}}
\usepackage{soul,color}
\soulregister\Hl{7}
\soulregister\ref7
\soulregister\cite7
\soulregister\pageref7
\begin{document}
\section{title}
\label{key}
\Hl{\ref{key}}
\Hl{\cite{knuth:ct:a}}
\bibliographystyle{plain}
\bibliography{biblatex-examples}
\end{document}
同时突出显示 bititem:
\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}
%% Following for different color highlight using \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
\newcommand{\Hl}[2][\empty]{%
\ifx#1\empty
\else
\sethlcolor{#1}%
\fi
\hl{#2}}
\usepackage{soul,color}
\soulregister\Hl{7}
\soulregister\ref7
\soulregister\cite7
\soulregister\pageref7
\usepackage{etoolbox}
\makeatletter
\pretocmd\@bibitem{\csname keycolor#1\endcsname}{}{\fail}
\newcommand\citecolor[2][yellow]{\@namedef{keycolor#2}{\hspace*{-\labelwidth}\hspace*{-\labelsep}{\color{#1}\rule[-0.3em]{\dimexpr\linewidth+\labelwidth+\labelsep\relax}{1\baselineskip}}\vspace*{\itemsep}\vspace*{-\baselineskip}}}
\makeatother
\citecolor{knuth:ct:a}
\citecolor[red]{knuth:ct:c}
\begin{document}
\section{title}
\label{key}
\Hl{\ref{key}}
\Hl[red]{\cite{knuth:ct:c}}
\Hl[yellow]{\cite{knuth:ct:a}}
\cite{knuth:ct:b}
\bibliographystyle{plain}
\bibliography{biblatex-examples}
\end{document}
(如果引用超过一行,相应增加1\baselineskip
)
您好,我正在写一篇修改后的文章。我用不同的背景颜色突出显示修订文本的背景。我成功地突出了它们,但我无法突出显示底部参考文献中的引文。
\documentclass[journal]{IEEEtran}
\ifCLASSINFOpdf
\else
\fi
%% Following for different color highlight using \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
\newcommand{\Hl}[2][\empty]{%
\ifx#1\empty
\else
\sethlcolor{#1}%
\fi
\hl{#2}}
\usepackage{soul,color}
\soulregister\Hl{7}
\soulregister\ref7
\soulregister\pageref7
\begin{document}
\Hl[r2]{I wanted to highlight this \cite{miguel14anestimator}. It was
successful highlighted in the main text. But the problem is it was not
highlighted in the Bottom References?}
@ARTICLE{miguel14anestimator,
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},}
\end{document}
\ref
已经使用您的代码开箱即用。要使 \cite
也兼容,您可以添加 \soulregister\cite7
\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}
%% Following for different color highlight using \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
\newcommand{\Hl}[2][\empty]{%
\ifx#1\empty
\else
\sethlcolor{#1}%
\fi
\hl{#2}}
\usepackage{soul,color}
\soulregister\Hl{7}
\soulregister\ref7
\soulregister\cite7
\soulregister\pageref7
\begin{document}
\section{title}
\label{key}
\Hl{\ref{key}}
\Hl{\cite{knuth:ct:a}}
\bibliographystyle{plain}
\bibliography{biblatex-examples}
\end{document}
同时突出显示 bititem:
\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}
%% Following for different color highlight using \textcolor{r1}{text}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\colorlet{r1}{ForestGreen!20}
\colorlet{r2}{Red!20}
\colorlet{r3}{RoyalPurple!20}
\newcommand{\Hl}[2][\empty]{%
\ifx#1\empty
\else
\sethlcolor{#1}%
\fi
\hl{#2}}
\usepackage{soul,color}
\soulregister\Hl{7}
\soulregister\ref7
\soulregister\cite7
\soulregister\pageref7
\usepackage{etoolbox}
\makeatletter
\pretocmd\@bibitem{\csname keycolor#1\endcsname}{}{\fail}
\newcommand\citecolor[2][yellow]{\@namedef{keycolor#2}{\hspace*{-\labelwidth}\hspace*{-\labelsep}{\color{#1}\rule[-0.3em]{\dimexpr\linewidth+\labelwidth+\labelsep\relax}{1\baselineskip}}\vspace*{\itemsep}\vspace*{-\baselineskip}}}
\makeatother
\citecolor{knuth:ct:a}
\citecolor[red]{knuth:ct:c}
\begin{document}
\section{title}
\label{key}
\Hl{\ref{key}}
\Hl[red]{\cite{knuth:ct:c}}
\Hl[yellow]{\cite{knuth:ct:a}}
\cite{knuth:ct:b}
\bibliographystyle{plain}
\bibliography{biblatex-examples}
\end{document}
(如果引用超过一行,相应增加1\baselineskip
)