
對於科學出版物,我正在撰寫文章的修改版本,其中考慮了審查者的評論。我需要確定哪個修改是由哪個審查員完成的,因此我使用了該changes
套件。顯然,我的文章中有參考文獻,所以我使用了該cite
套件。
當我在套件的或命令cite
中使用該命令時,PDFLaTeX (TexLive 2014) 會出現錯誤。這是一個最小的工作範例:deleted
replaced
changes
\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
答案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
或\add
track 更改命令時 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)
這對我有用。