引用内下划线/删除线 :tex

引用内下划线/删除线 :tex

我正在写一篇文章,需要删除或划掉一些带引文的句子。我试着这样做,\uline{sentence1 \citep{reference1}, sentence continued \citep{reference2,reference3}}. 但它显示了这个警告extra }, or forgotten \end group。我试过了

  1. \protect在每个前面添加\citep\citet不起作用。
  2. 添加引文\mbox{\citex{reference1}},其效果有效并且警告消失,但\mbox分页符也消失了。

那么,有没有什么解决方案可以删除/划线而又不让里面的引用保持完整? PS:我正在使用ulemnatbib

答案1

此解决方案涉及在接近 的调用时关闭\uline和调用。对于这些引用,请使用本 MWE 中定义的和。然后,在引用之后,从您离开的地方继续 和。引用本身不会跨越一行,但 和会。\sout\citep\ulineref\soutref\uline\sout\uline\sout

此处的解决方案使censor包能够同时进行下划线和删除线。可以使用 更改线条的深度\censorruledepth,就像在\ulineref\soutref宏中使用一样。我尝试将这些值与包的现有线条深度相匹配ulem

\documentclass{article}
\usepackage{ulem}
\usepackage{censor}
\usepackage{natbib}
\bibliographystyle{plainnat}
\usepackage{filecontents}
\usepackage{calc}
%%%%%%%%%%%
\censorruleheight=.1ex %THICKNESS OF CENSOR RULE
\newlength\nextcharwidth
\makeatletter
\renewcommand\@cenword[1]{%
  \setlength{\nextcharwidth}{\widthof{#1}}%
  \censorrule{\nextcharwidth}%
  \kern -\nextcharwidth%
  #1}
\makeatother
\newcommand\ulineref[1]{\censorruledepth=-.67ex\censor{#1}}
\newcommand\soutref[1]{\censorruledepth=.55ex\censor{#1}}
%%%%%%%%%%%
\begin{filecontents}{\jobname.bib}
@article {MCOSW,
author = "Hugh Glaser and Afraz Jafri and Ian Millard",
title = "Managing co-reference on the semantic web",
journal = "WWW2009 Workshop: Linked Data on the Web (LDOW2009)",
month = "April",
year = "2009",
%
@article {MCOSX,
author = "Hugh Glaser and Afraz Jafri and Ian Millard",
title = "Managing co-reference on the semantic web",
journal = "WWW2009 Workshop: Linked Data on the Web (LDOW2009)",
month = "April",
year = "2009",
%
@article {MCOSY,
author = "Hugh Glaser and Afraz Jafri and Ian Millard",
title = "Managing co-reference on the semantic web",
journal = "WWW2009 Workshop: Linked Data on the Web (LDOW2009)",
month = "April",
year = "2009",
}
\end{filecontents}
\begin{document}
I will begin the underline 
\uline{sentence1 }%
\ulineref{\citep{MCOSW}}%
\uline{, sentence continued onto next line. }%
\ulineref{\citep{MCOSX,MCOSY}}%
\uline{ blah blah} 
followed by normal text

I will begin the strikeout
\sout{sentence1 }%
\soutref{\citep{MCOSW}}%
\sout{, sentence continued onto next line. }%
\soutref{\citep{MCOSX,MCOSY}}%
\sout{ blah blah} 
followed by normal text

\bibliography{\jobname}
\end{document}

在此处输入图片描述

相关内容