I am writing a document in latex, and I have a large .bib file and a large number of links. I want to have quotes in the format [Author, year], and I use the natbib package, but I can not get citep or citet to work, although simple cite works fine. The error I get is:
! Undefined control sequence. l.3 lets cite \citet{cayton05}
I use the Ubuntu texlive package and use the \input{<file>} latex command to enter chapters in the main .tex file.
Surprisingly, instead of using \input{<file>} , if I only have the text in the main .tex file, then all citation commands work.
Any help would be greatly appreciated.
The working version looks like this:
\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}
In the real .tex file, I enter the text of the chapter from another .tex file, and citep and citet will not work with the error above, although plain cite will work fine.
I forgot to mention earlier that I used a simple bibliographic style with simple numbers, and everything worked, so there is no error in the input .tex files.
latex biblatex
Dronacharya
source share