如何突出显示引用

如何突出显示引用

我需要突出显示出版物列表的引用(资助申请所需)。我尝试使用,\hl但收到以下错误消息:

LaTeX Warning: Citation '{abc}' on page 0 undefined on input line 25.

! Argument of \blx@citeargs@iii has an extra }.
<inserted text>
                \par
l.25    \item \hl{\fullcite{abc}}

这是代码(如果注释掉倒数第三行则不会出错\item \hl{\fullcite{abc}}

\documentclass[british]{article}
\usepackage{enumitem}
\usepackage{color}
\usepackage{soul}
\setlist[enumerate]{itemsep=0mm}
\usepackage[style=authoryear, backend=biber,maxbibnames=99,defernumbers=true,sorting=ynt,giveninits=true]{biblatex}
\begin{filecontents}{\jobname.bib}
@article{abc,
author = {John Doe and Jane Doe and Kate Smith and Bob Muller},
year = {1970},
title = {Article Title which is indeed very long},
journaltitle = {Journal Name which is indeed also very very very very long},
volume = {1},
number = {2},
pages = {13--17},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\section{Publications}
 \begin{enumerate}
   \item \fullcite{abc}
   %\item \hl{\fullcite{abc}}
 \end{enumerate}
\end{document}

在此处输入图片描述

编辑

我尝试colorbox按照建议使用,但是这会强制引用位于一行上,因此引用超出了文档的边缘:

\documentclass[british]{article}
\usepackage{enumitem}
\usepackage[usenames,dvipsnames]{color} 
\usepackage{soul}
\setlist[enumerate]{itemsep=0mm}
\usepackage[style=authoryear, backend=biber,maxbibnames=99,defernumbers=true,sorting=ynt,giveninits=true]{biblatex}
\begin{filecontents}{\jobname.bib}
@article{abc,
author = {John Doe and Jane Doe and Kate Smith and Bob Muller},
year = {1970},
title = {Article Title which is indeed very long},
journaltitle = {Journal Name which is indeed also very very very very long},
volume = {1},
number = {2},
pages = {13--17},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\section{Publications}
 \begin{enumerate}
   \item \fullcite{abc}
   \item \colorbox{BurntOrange}{\fullcite{abc}}
 \end{enumerate}
\end{document}

在此处输入图片描述

答案1

嵌套\parbox在 a 中\colorbox就足够了:

\documentclass{article}
\usepackage{xcolor}
\usepackage[style=authoryear ]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\section{Publications}
 \begin{enumerate}
    \item \fullcite{abc}
    \item \colorbox{yellow}{\parbox[t]{\linewidth}{\fullcite{abc}}}
 \end{enumerate}
\end{document}

姆韦

相关内容