Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
    
Welcome to TeX.sx! Can you give an example of an entry in the references.bib file? –  egreg Feb 18 '13 at 13:37
    
Thanks for the quick reply. I use endnote for managing references and then later imported them to Jabref, then used automatic key generation of jabref before exporting the library as references.bib –  Rajaraja Chola Feb 18 '13 at 13:42
    
Can you add the contents of the .bbl file you get when running BibTeX on the minimal example above? –  egreg Feb 18 '13 at 13:45
1  
You wrote " I deleted the references from other parts of my document for convenience):". This indicates that you didn't test the minimal example but some larger document. Do you get the same result if you really run the minimal example? –  Ulrike Fischer Feb 18 '13 at 13:59
1  
Well create a minimal example - that is not an arbitrary small example, but a small example that demonstrates the problem. So start with your problematic document and strip it down. –  Ulrike Fischer Feb 18 '13 at 14:11
show 7 more comments

1 Answer

I carefully sifted through the code, removing bits and pieces and checked for the output. It seems \usepackage{newclude} was the culprit. Without newclude, the citation is displayed perfectly as desired i.e. Author-year.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.