我如何像这样突出显示(设置背景颜色)\cite
(保留换行符:[1]
当我在\hl
包中尝试使用soul
时出现编译错误:
\hl{\cite{xxx}}
[\mobx
可以解决此问题,但不支持换行。
我也尝试过\colorbox
和\newcommand\hl{\bgroup\markoverwith {\textcolor{GhostWhite}{\rule[-.5ex]{2pt}{2.5ex}}}\ULon}
,但它们也不支持换行。
main.tex:
\documentclass{article}
\usepackage{soul}
\begin{document}
\hl{{\cite{c1, c2, c3}}}
\bibliographystyle{plain}
\bibliography{ref}
\end{document}
ref.bib:
@book{c1,
...
}
@book{c2,
...
}
@book{c3,
...
}
\cite
的正确方法是什么>我如何像这样突出显示(设置背景颜色)\ cite(保留换行符):[1]在软件包灵魂中尝试\ hl时出现编译错误,例如:\ hl {\ cite {xxx}} \ mobx可以解决此问题,但不能解决......>
将\cite
宏包装到另一组大括号中:
\documentclass{article}
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{knuth,
author = {Knuth, Donald E.},
title = {The {\TeX} book},
date = 1984,
maintitle = {Computers \& Typesetting},
volume = {A},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
langid = {english},
langidopts = {variant=american},
sortyear = {1984-1},
sorttitle = {Computers & Typesetting A},
indexsorttitle= {The TeXbook},
indextitle = {\protect\TeX book, The},
shorttitle = {\TeX book}
}
\end{filecontents*}
\usepackage{soul}
\begin{document}
\hl{{\cite{knuth}}}
\bibliographystyle{plain}
\bibliography{\jobname}
\end{document}