10

我正在用乳胶写一个文档,我有一个很大的 .bib 文件和大量引用。我想以 [Author, year] 格式引用并使用包natbib,但无法使citepcitet工作,尽管普通 cite 工作正常。我得到的错误是:

! Undefined control sequence.
l.3 lets cite \citet{cayton05}

我正在使用Ubuntu texlive包并使用\input{<file>}latex 命令将章节输入到主 .tex 文件中。

令人惊讶的是,\input{<file>}如果我只是在主 .tex 文件中有文本,那么所有的引用命令都可以正常工作,而不是使用。

任何帮助将不胜感激。

工作版本是这样的:

\usepackage{cite} 
\usepackage[square,sort]{natbib}
%% lot of other packages and formatting %%

\begin{document}

\chapter{Testing citations}

\begin{enumerate}
  \item this is the first citation \cite{belkin02}.
  \item this is the second citation \citep{belkin02}.
  \item this is the third citation \cite{shlens03}.
\end{enumerate}



\phantomsection\addcontentsline{toc}{chapter}{Bibliography}
\begin{spacing}{1.5}
\nocite{*}
\bibliographystyle{apalike}
\bibliography{testnb.bib}
\end{spacing}

\end{document}

在真正的 .tex 文件中,我从另一个 .tex 文件中输入了章节文本,citep并且citet不会在给出上述错误的情况下工作,尽管 plaincite可以正常工作。

我之前忘了提到我使用的是普通编号的参考书目样式,并且一切正常,因此输入的 .tex 文件中没有错误。

4

2 回答 2

19

如果\citep并且\citet不工作,那么您可能没有加载natbib.

从我目前正在处理的文件中:

 \usepackage[authoryear,round,longnamesfirst]{natbib}

您可能需要不同的选项——有关详细信息,请参阅方便的 natbib 参考表

于 2010-12-09T01:45:25.617 回答
5

你应该只包括\usepackage[square,sort]{natbib}.

删除后即可使用\usepackage{cite}

于 2012-10-01T18:09:52.313 回答