Well, there seem to be two problems:
- You missed to add a bibliographystyle like
\bibliographystyle{abbrvnat}
- It seems your TeX distribution is a little bit outdated ...
With the following MWE
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Test, A. and Foo, B.},
year = {2001},
title = {Alpha},
}
@misc{A02,
author = {Alex, A. and Bar, B.},
year = {2005},
title = {Alpha},
}
\end{filecontents}
\listfiles %<========= creates list of used packages and version numbers
\documentclass{article}
\usepackage[authoryear]{natbib}
\begin{document}
\citep{A01}, citep: \citep{A02}, citet: \citet{A02}
\bibliographystyle{abbrvnat} % <=======================================
\bibliography{\jobname}
\end{document}
I get without error message the following result:
If you take a look into the .log
file (for example 386491.log
, if the TeX file is names 386491.tex
)
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6400 64-bit) (preloaded format=pdflatex 2017.4.26) 15 AUG 2017 19:37
entering extended mode
**./386491.tex
(386491.tex
LaTeX2e <2017-04-15>
Babel <3.9r> and hyphenation patterns for 76 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\filecontents\filecontents.sty"
Package: filecontents 2011/10/08 v1.3 Create an external file from within a LaTeX document
)
LaTeX Warning: Overwriting file `./386491.bib'.
\openout15 = `386491.bib'.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) ("C:\Program Files\MiKTeX 2.9\tex\latex\natbib\natbib.sty"
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip43
\bibsep=\skip44
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count87
)
(386491.aux)
\openout1 = `386491.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 23.
LaTeX Font Info: ... okay on input line 23.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 23.
LaTeX Font Info: ... okay on input line 23.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 23.
LaTeX Font Info: ... okay on input line 23.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 23.
LaTeX Font Info: ... okay on input line 23.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 23.
LaTeX Font Info: ... okay on input line 23.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 23.
LaTeX Font Info: ... okay on input line 23.
(386491.bbl) [1
{C:/Users/Internet/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (386491.aux)
*File List*
filecontents.sty 2011/10/08 v1.3 Create an external file from within a LaTeX document
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
natbib.sty 2010/09/13 8.31b (PWD, AO)
386491.bbl
***********
)
Here is how much of TeX's memory you used:
564 strings out of 493324
6475 string characters out of 3138984
58170 words of memory out of 3000000
4171 multiletter control sequences out of 15000+200000
4245 words of font info for 16 fonts, out of 3000000 for 9000
1141 hyphenation exceptions out of 8191
24i,4n,32p,145b,312s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmbx12.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public
/amsfonts/cm/cmr10.pfb>
Output written on 386491.pdf (1 page, 24658 bytes).
PDF statistics:
14 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
you can see in the first line that I am using a current MiKTeX 2,9, version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6400 64-bit)
and my system used the following packages (created with command \listfiles
):
*File List*
filecontents.sty 2011/10/08 v1.3 Create an external file from within a LaTeX document
article.cls 2014/09/29 v1.4h Standard LaTeX document class
size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
natbib.sty 2010/09/13 8.31b (PWD, AO)
Please compare this numbers with yours. From the screenshot you showed us I guess your sytem is a little bit older. Please update ...
[Alex and Bar, 2005]
. Show your log-file and the blg-file.