apa6
我想使用该类和包将参考书目部分中的特定引文(比如 Jahani 等人)用红色标注apacite
。
这是我的.tex
文件:
\documentclass[a4paper,man,noextraspace,apacite]{apa6}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{inputenc}
\title{Title of the Study}
\begin{document}
\maketitle
I want to color \citeA{jahani2018motion} in red in bibliography section. However, I want \citeA{drenckhahn2015validation} and \citeA{magistretti1999energy} to remain in black.
\bibliography{references}
\end{document}
这是我的.bib
文件:
@article{drenckhahn2015validation,
title={A validation study of the use of near-infrared spectroscopy imaging in primary and secondary motor areas of the human brain},
author={Drenckhahn, Christoph and Koch, Stefan P and D{\"u}mmler, Johannes and Kohl-Bareis, Matthias and Steinbrink, Jens and Dreier, Jens P},
journal={Epilepsy \& Behavior},
doi={10.1016/j.yebeh.2015.04.006},
volume={49},
pages={118--125},
year={2015},
publisher={Elsevier}
}
@article{jahani2018motion,
title={Motion artifact detection and correction in functional near-infrared spectroscopy: {A} new hybrid method based on spline interpolation method and {S}avitzky--{G}olay filtering},
author={Jahani, Sahar and Setarehdan, Seyed K and Boas, David A and Y{\"u}cel, Meryem A},
journal={Neurophotonics},
doi={10.1117/1.NPh.5.1.015003},
volume={5},
number={1},
pages={1--11},
year={2018},
publisher={International Society for Optics and Photonics}
}
@article{magistretti1999energy,
title={Energy on demand},
author={Magistretti, Pierre J and Pellerin, Luc and Rothman, Douglas L and Shulman, Robert G},
journal={Science},
doi={10.1126/science.283.5401.496},
volume={283},
pages={496--497},
year={1999},
publisher={American Association for the Advancement of Science}
}
有人能帮我吗?
答案1
服用乌尔丽克·菲舍尔的回答到着色参考,但将其扩展到具有明确标签的项目,我们得到
\documentclass[a4paper,man,noextraspace,apacite]{apa6}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{etoolbox}
\makeatletter
\apptocmd\@bibitem{\color{black}\csname keycolor#1\endcsname}{}{\fail}
\apptocmd\@lbibitem{\color{black}\csname keycolor#2\endcsname}{}{\fail}
\newcommand\citecolor[2][red]{\@namedef{keycolor#2}{\color{#1}}}
\makeatother
\citecolor[blue]{jahani2018motion}
\shorttitle{Study}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{drenckhahn2015validation,
title = {A validation study of the use of near-infrared spectroscopy
imaging in primary and secondary motor areas of the human brain},
author = {Drenckhahn, Christoph and Koch, Stefan P. and D{\"u}mmler, Johanne
and Kohl-Bareis, Matthias and Steinbrink, Jens and Dreier, Jens P.},
journal = {Epilepsy \& Behavior},
doi = {10.1016/j.yebeh.2015.04.006},
volume = {49},
pages = {118--125},
year = {2015},
}
@article{jahani2018motion,
title = {Motion artifact detection and correction in functional
near-infrared spectroscopy:
{A} new hybrid method based on spline interpolation method
and {S}avitzky--{G}olay filtering},
author = {Jahani, Sahar and Setarehdan, Seyed K. and Boas, David A.
and Y{\"u}cel, Meryem A.},
journal = {Neurophotonics},
doi = {10.1117/1.NPh.5.1.015003},
volume = {5},
number = {1},
pages = {1--11},
year = {2018},
}
@article{magistretti1999energy,
title = {Energy on demand},
author = {Magistretti, Pierre J. and Pellerin, Luc and Rothman, Douglas L.
and Shulman, Robert G.},
journal = {Science},
doi = {10.1126/science.283.5401.496},
volume = {283},
pages = {496--497},
year = {1999},
}
\end{filecontents}
\begin{document}
I want to color \citeA{jahani2018motion} in red in bibliography section
However, I want \citeA{drenckhahn2015validation}
and \citeA{magistretti1999energy} to remain in black.
\bibliography{\jobname}
\end{document}
\citecolor
可以在 之前的任何位置发出\bibliography
。该命令有两个参数。可选(第一个)参数是颜色,必选(第二个)参数是要突出显示的条目的键。