我正在用乳胶写一个文档,我有一个很大的 .bib 文件和大量引用。我想以 [Author, year] 格式引用并使用包natbib,但无法使citep或citet工作,尽管普通 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 文件中没有错误。