Trying to create a simple document with package natbib but I get the following

pdflatex mydocument.tex


is fine but with some warnings like

Package natbib Warning: Citation Dukes:2011:OSP:2206329.2206341' on page 1 und
efined on input line 15.


and bibtex mydocument.aux complains that it can't the find the 'plainnat.bst' file.

---line 11 of file proposal.aux
: \bibstyle{plainnat
:                   }
I'm skipping whatever remains of this command
I found no style file---while reading file proposal.aux


I have MacTex 2012 and have made sure that I have plainnat in ~/Library/texmf/bibtex/bst.

## Example that does not work

\documentclass[12pt]{article}

\usepackage[authoryear]{natbib}

\begin{document}

Bla bla bal \citep{test}

\bibliographystyle{plainnat}
\bibliography{../bibliography}

\end{document}


where bibliography.bib is

@article{test,
author = "aba",
title = "a",
journal = "aa",
year = "2013"}

-

## closed as too localized by Alan Munn, lockstep, Guido, diabonas, Paul GaboritJan 13 '13 at 22:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Welcome to TeX.sx! A tip: You can use backticks  to mark your inline code as I did in my edit. If you indent lines by 4 spaces or enclose words in backticks , they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). – Guido Jan 6 '13 at 22:56
You shouldn't need to have a local copy of plainnat.bst since it is part of MacTeX already. Can you post a minimal document that shows the problem. – Alan Munn Jan 6 '13 at 23:00
I have edited my question to include an example that does not work. – Hajder Rabiee Jan 7 '13 at 22:44
As already Alan said, you shouldn't need to have plainnat.bst in your home subtree. You should have it in /usr/local/texlive/2012/texmf-dist/bibtex/bst/natbib/plainnat.bst; please, check it. – egreg Jan 8 '13 at 7:40
Your posted code compiles fine here. Could there be a problem with file permissions? – Andrew Swann Jan 8 '13 at 7:59

So I changed the order of the paths in PATH in my .bash_profile` so bibtex was version 2012. It works fine now.