[Tex/LaTex] \citep does not work using natbib package

bibliographiesnatbib

The \citep command does not display the author and year, instead it displays a number.

This is the head file.

\usepackage{times}
\usepackage{a4wide}
\usepackage{fancyheadings}

\usepackage{natbib} % various citation commands
\usepackage{siunitx}

\usepackage{epsfig}
\usepackage{pifont}
\usepackage{fancybox}
\usepackage{amssymb}

This is the end, references are stored in DM.bib

\bibliographystyle{apalike}
\bibliography{DM}

Can anyone tell me what is wrong with it? I want to cite author and year, but not just a number.

Best Answer

Your code fragments are not very helpful. I create a minimal example which produced the result seen in the picture below.


Most of your loaded packages are obsolete.

Some obsolete packages are collected in the Q&A: How to keep up with packages and know which ones are obsolete?

In your case the packages: times, a4wide, fancyheadings, epsfig

If you had an old LaTeX-installation you should install TeXLive 2011.


Now the example:

\documentclass{article} 
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Mustermann,
 author = {Mustermann, A. and Mostermann, B. and Mistermann, C},
 year = {2011},
 title = {Using articles in {\LaTeX} documents},
 journal = {Journal}
}
\end{filecontents}
\usepackage{natbib} 
\begin{document} 
\cite{Mustermann}\qquad\citet{Mustermann}\qquad\citep{Mustermann}

\citeyear{Mustermann}\qquad\citeauthor{Mustermann}

\bibliographystyle{apalike}
\bibliography{\jobname}
\end{document}

The result is: enter image description here

Related Question