论文到了修改阶段,不可避免就要标记对应的修改部分,之前修改设计的都是正文部分的内容,修改颜色的代码相对简单,
如下所示:
\textcolor{blue}{正文修改后需要标记的句子}
这样的代码无法跨行标记,想要实现跨行标记的话逐段标记
\textcolor{blue}{第一段}\textcolor{blue}{第二段}
那么这次涉及到参考文献部分需要标记成蓝色
方法代码放这里啦:
(一)text文件部分
\usepackage{xcolor}
\usepackage{xpatch}\makeatletter
\def\changeBibColor#1{%\in@{#1}{SUN2021107894,SZOPLIK2023126001}% list of colored bib items\ifin@\color{blue}\else\normalcolor\fi
}\xpatchcmd\@bibitem{\item}{\changeBibColor{#1}\item}{}{\fail}\xpatchcmd\@lbibitem{\item}{\changeBibColor{#2}\item}{}{\fail}
\makeatother\begin{document}VVV\bibliography{mybib}\end{document}
代码里面的SUN2021107894,SZOPLIK2023126001就是我这里对应标记蓝色的文章,从bib文件里面对应Id
(二)bib文件部分
\begin{filecontents}{mybib.bib} %%%加在bib文件开头@article{SUN2021107894,
title = {Multi-step wind speed forecasting based on secondary decomposition algorithm and optimized back propagation neural network},
journal = {Applied Soft Computing},
volume = {113},
pages = {107894},
year = {2021},
author = {Wei Sun and Bin Tan and Qiqi Wang},
}@article{SZOPLIK2023126001,
title = {Using an artificial neural network model for natural gas compositions forecasting},
journal = {Energy},
volume = {263},
pages = {126001},
year = {2023},
author = {Jolanta Szoplik and Paulina Muchel},
}\end{filecontents} %%%加在bib文件结尾
完成之后编译即可,其他的latex详细代码可见我之前的文章
Latex投稿Elsevier后被要求修改格式(一)代码的初步探索_\begin{frontmatter}_Loveumm的博客-CSDN博客https://blog.csdn.net/weixin_45853843/article/details/126941386?spm=1001.2014.3001.5502
文章参考:
LaTex修改参考文献的颜色-BiBTeX-包括参考文献的序号颜色_latex编号颜色_妙手书生2016的博客-CSDN博客https://blog.csdn.net/weixin_36602742/article/details/109438192?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167962646216782427497757%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=167962646216782427497757&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~first_rank_ecpm_v1~rank_v31_ecpm-2-109438192-null-null.142%5Ev76%5Econtrol_1,201%5Ev4%5Eadd_ask,239%5Ev2%5Einsert_chatgpt&utm_term=%E4%BF%AE%E6%94%B9%E5%8F%82%E8%80%83%E6%96%87%E7%8C%AE%E9%A2%9C%E8%89%B2&spm=1018.2226.3001.4187