2010-12-09 35 views
6

我正在寫一個乳膠文檔,我有一個大的.bib文件和大量的引文。 我想有形式[作者,年]格式引文和現在用的是包natbib,但不能得到citepcitet工作,雖然平淡舉是工作的罰款。我得到的錯誤是:即使使用natbib軟件包,citep和citet也無法正常工作

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

我使用Ubuntu的的texlive包,然後用\input{<file>}乳膠命令輸入章節主要.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文件,citepcitet將無法​​正常工作中,給予上述錯誤,儘管普通cite會正常工作。

我之前忘了提及我使用的是簡單編號的書目風格,而且所有東西都在工作,所以在輸入.tex文件中沒有錯誤。

+1

以防萬一您不知道,有一個更集中的問答網站Tex /乳膠 - http://tex.stackexchange.com/ – InSane 2010-12-09 01:49:52

回答

17

如果\citep\citet不起作用,那麼您可能沒有加載natbib

從文檔我目前工作:

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

您可能需要不同的選擇 - 看handy reference sheet for natbib瞭解詳情。

+0

你可以發佈一個小的自包含的例子,沒有說明這個問題? – 2010-12-09 02:22:37

3

您應該只包括\usepackage[square,sort]{natbib}

刪除後會起作用\usepackage{cite}

相關問題