I am using MiKTeX 2.9/TeXmaker. When I cite(\citep{}) with the natbib package, I get random characters e.g [a],[x] etc, instead of e.g [John1998]. I ran PdfLatex->Bibtex->Pdflatex->Pdflatex, but still getting the same result. I am writing my first document in LaTeX and its my thesis, so please forgive if I overlooked any minor error or method.
\documentclass[a4paper,12pt]{book}
\usepackage[square,authoryear]{natbib}
\usepackage{hyperref}
\begin{document}
Photonic crystals are a class of materials
that are either man made\citep{Yablonovitch1993} or
naturally found\citep{Zi2003}
.
.
.
.
.
\backmatter
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}
Output:
Photonic crystals are a class of materials that are either man made[b, a] or naturally found [e, i].
Within BibTeX file
@ARTICLE{Yablonovitch1993,
author = {Yablonovitch, E.},
title = {Photonic band-gap structures},
journal = {J. Opt. Soc. Am. B},
year = {1993},
volume = {10},
pages = {283-295},
number = {2}
}
@ARTICLE{Zi2003,
author = {Zi, Jian and Yu, Xindi and Li, Yizhou and Hu, Xinhua and Xu, Chun
and Wang, Xingjun and Liu, Xiaohan and Fu, Rongtang},
title = {Coloration strategies in peacock feathers},
journal = {Proceedings of the National Academy of Sciences},
year = {2003},
volume = {100},
pages = {12576-12578},
number = {22},
abstract = {We report the mechanism of color production in peacock feathers. We
find that the cortex in differently colored barbules, which contains
a 2D photonic-crystal structure, is responsible for coloration. Simulations
reveal that the photonic-crystal structure possesses a partial photonic
bandgap along the direction normal to the cortex surface, for frequencies
within which light is strongly reflected. Coloration strategies in
peacock feathers are very ingenious and simple: controlling the lattice
constant and the number of periods in the photonic-crystal structure.
Varying the lattice constant produces diversified colors. The reduction
of the number of periods brings additional colors, causing mixed
coloration.}
}
.bbl file contents (Only the above two references are shown. I deleted the references from other parts of my document for convenience):
\begin{thebibliography}{29}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi: #1}\else
\providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi
\bibitem[Yablonovitch(1993)]{Yablonovitch1993}
E.~Yablonovitch.
\newblock Photonic band-gap structures.
\newblock \emph{J. Opt. Soc. Am. B}, 10\penalty0 (2):\penalty0 283--295, 1993.
\bibitem[Zi et~al.(2003)Zi, Yu, Li, Hu, Xu, Wang, Liu, and Fu]{Zi2003}
Jian Zi, Xindi Yu, Yizhou Li, Xinhua Hu, Chun Xu, Xingjun Wang, Xiaohan Liu,
and Rongtang Fu.
\newblock Coloration strategies in peacock feathers.
\newblock \emph{Proceedings of the National Academy of Sciences}, 100\penalty0
(22):\penalty0 12576--12578, 2003.
\end{thebibliography}
references.bibfile? – egreg Feb 18 at 13:37.bblfile you get when running BibTeX on the minimal example above? – egreg Feb 18 at 13:45