我正在使用latex写一份文档,有一个大的.bib文件和大量引用。我想以[作者,年份]格式显示引用,并使用natbib包,但无法让citep或citet工作,尽管简单的cite可以正常工作。 我得到的错误是:
! Undefined control sequence.
l.3 lets cite \citet{cayton05}
我正在使用Ubuntu texlive软件包,并使用\input{<file>}
LaTeX命令将章节输入到主.tex文件中。
令人惊奇的是,如果我在主.tex文件中只有文本而没有使用\input{<file>}
命令,则所有引用命令都能正常工作。
非常感谢任何帮助。
工作版本如下:
\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
,但是会出现上述错误,尽管简单的 cite
可以正常工作。
我之前忘了提到我正在使用普通编号的参考文献样式,一切都正常工作,所以输入的 .tex 文件没有错误。