[Tex/LaTex] citet and citep behaves like cite

citingnatbib

I am new with LaTeX so please bare with me. If its matter editor that I am using is TeXMaker, the TeXLive is installed. Why \citep and \citet did not display citation as a "Goossens et al. (1993)" or "(Goossens et al., 1993)" but just as a simple number in brackets [1] (exactly same like \cite)?

\documentclass[11pt]{article}


% old citation style (used by \cite)
%\usepackage{cite}

% package used by \citep and \citet
\usepackage[sort&compress,square,comma,authoryear]{natbib}

% makes color citations
\usepackage[dvips,dvipdfm,colorlinks=true,urlcolor=blue,citecolor=red,linkcolor=red,bookmarks=true]{hyperref}

% document begin
\begin{document}

% author and title
\title{My Article}
\author{Author Name}
\date{Today}
\maketitle

Blablabla said by \cite{lamport94} cite example. Blablabla said by \cite[p.~215]{impj} cite example. Blablabla said by \cite{fo,norman,lamport94} multiple cite example. Blablabla said by \nocite{lamport94} nocite example.
Blablabla said by \citep{lamport94} citep example. Blablabla said by \citet*{impj} citet example. Blablabla said by \citet{impj} citet example.

% this must be set to use natbib (citep, citet)
\bibliographystyle{plainnat}

% number 99 determines how much citation can be included in file (maximum 99)
\begin{thebibliography}{99}

\bibitem{lamport94}
  Leslie Lamport,
  \emph{\LaTeX: A Document Preparation System}.
  Addison Wesley, Massachusetts,
  2nd Edition,
  1994.

   \bibitem{notes} John W. Dower {\em Readings compiled for History
  21.479.}  1991.

  \bibitem{impj}  The Japan Reader {\em Imperial Japan 1800-1945} 1973:
  Random House, N.Y.

  \bibitem{norman} E. H. Norman {\em Japan's emergence as a modern
  state} 1940: International Secretariat, Institute of Pacific
  Relations.

  \bibitem{fo} Bob Tadashi Wakabayashi {\em Anti-Foreignism and Western
  Learning in Early-Modern Japan} 1986: Harvard University Press.

\end{thebibliography}



\end{document}
% http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management

Best Answer

The author-year citation style requires usage of BibTeX or specially formatted \bibitem commands.

If you don't want to use BibTeX, then you must hand format your thebibliography environment as in the following example.

\documentclass[11pt]{article}


\usepackage[sort&compress,square,comma,authoryear]{natbib}

% makes color citations
\usepackage[colorlinks=true,urlcolor=blue,citecolor=red,linkcolor=red,bookmarks=true]{hyperref}

% document begin
\begin{document}

% author and title
\title{My Article}
\author{Author Name}
\date{Today}
\maketitle

Blablabla said by \cite{lamport94} cite example. Blablabla said by \cite[p.~215]{impj} cite example. Blablabla said by \cite{fo,norman,lamport94} multiple cite example. Blablabla said by \nocite{lamport94} nocite example.
Blablabla said by \citep{lamport94} citep example. Blablabla said by \citet*{impj} citet example. Blablabla said by \citet{impj} citet example.

% this must be set to use natbib (citep, citet) but requires BibTeX
\bibliographystyle{plainnat}

% number 99 determines how much citation can be included in file (maximum 99)
\begin{thebibliography}{99}

\bibitem[Lamport(1994)]{lamport94}
  Leslie Lamport,
  \emph{\LaTeX: A Document Preparation System}.
  Addison Wesley, Massachusetts,
  2nd Edition,
  1994.

\bibitem[Dower(1991)]{notes} John W. Dower {\em Readings compiled for History
  21.479.}  1991.

\bibitem[Japan Reader(1973)]{impj}  The Japan Reader {\em Imperial Japan 1800-1945} 1973:
  Random House, N.Y.

\bibitem[Norman(1940)]{norman} E. H. Norman {\em Japan's emergence as a modern
  state} 1940: International Secretariat, Institute of Pacific
  Relations.

\bibitem[Wakabayashi(1986]{fo} Bob Tadashi Wakabayashi {\em Anti-Foreignism and Western
  Learning in Early-Modern Japan} 1986: Harvard University Press.

\end{thebibliography}



\end{document}

enter image description here

Never pass explicit driver names to hyperref.


If you want a "mixed" system like "Author [number]", then you can say

\usepackage[sort&compress,square,comma,numbers]{natbib}

\DeclareRobustCommand{\citeext}[1]{\citeauthor{#1}~\cite{#1}}

and then \citeext{lamport} will give you

Lamport [1]