與引用和更改的衝突

與引用和更改的衝突

對於科學出版物,我正在撰寫文章的修改版本,其中考慮了審查者的評論。我需要確定哪個修改是由哪個審查員完成的,因此我使用了該changes套件。顯然,我的文章中有參考文獻,所以我使用了該cite套件。

當我在套件的或命令cite中使用該命令時,PDFLaTeX (TexLive 2014) 會出現錯誤。這是一個最小的工作範例:deletedreplacedchanges

\documentclass{article}

\usepackage{cite}
\usepackage{changes}

\begin{document}

As previously observed \deleted{in \cite{someref}, there is no banana here.}

\begin{thebibliography}{9}
\bibitem{someref} 
Some ref here.
\end{thebibliography}

\end{document}

我收到以下錯誤:

! Extra }, or forgotten \endgroup.
\UL@stop ...alty \ifnum \lastkern =\thr@@ \egroup
\egroup \ifdim \wd \UL@box...
l.8 ...n \cite{someref}, there is no banana here.}


! Extra }, or forgotten \endgroup.
\UL@stop ...num \lastkern =\thr@@ \egroup \egroup
\ifdim \wd \UL@box =\z@ \e...
l.8 ...n \cite{someref}, there is no banana here.}


! Missing } inserted.
<inserted text>
}
l.8 ...n \cite{someref}, there is no banana here.}


! Missing } inserted.
<inserted text>
}
l.8 ...n \cite{someref}, there is no banana here.}

如果我刪除cite軟體包,一切都會恢復正常。不幸的是,我需要這個包。

這個問題真的很接近這個沒有答案的。我該怎麼辦?

答案1

正如daleif在評論中指出的那樣,問題是由於ulem用於刪除changes包中已刪除更改的包造成的。眾所周知,它在某些讚揚中表現得很奇怪,其中包括cite

如中所示文件,你必須將你的包裝citembox這樣:

As previously observed \deleted{in \mbox{\cite{someref}}, there is no banana here.}

它有效。

一個非常相似的問題以同樣的方式解決這裡

答案2

@Neraste 說得對。我剛剛發現同樣的問題,我想避免\mbox{\cite{someref}}每次引用......所以,基於,我剛剛使用:

\let\oldcitep\citep
\renewcommand{\citep}[1]{\mbox{\oldcitep{#1}}}
\let\oldcitet\citet
\renewcommand{\citet}[1]{\mbox{\oldcitet{#1}}}
\let\oldcite\cite
\renewcommand{\cite}[1]{\mbox{\oldcite{#1}}}

效果很好

答案3

\mbox不適合我。

\cite然而,我對使用inside\remove\addtrack 更改命令時 LaTeX 崩潰的問題有了一些令人滿意的解決方案。解決方法只是忽略顯示的引用。

以下是我在 Latex 文件頂部使用的命令:

\usepackage[ignoremode,inline]{trackchanges} % use the "ignoremode" option here

\tcignore{\cite}{1}{0}  % To ignore parenthetical citation (previously used to be \citep)

\tcignore{\citeA}{1}{0} % To ignore in-text citation (previously used to be \citet)

這對我有用。

相關內容