As you have discovered, the error is caused by the line:
\renewcommand{\bibname}{Bibliography \addcontentsline{toc}{chapter}{Bibliography}}
This is a terrible place to put the \addcontentsline
command, and that's the source of the problem. The simplest solution (without modifying the package itself) is simply to undo this command and put the two parts separately into your document:
\bibliographystyle{plain}
\renewcommand{\bibname}{Bibliography}
\addcontentsline{toc}{chapter}{Bibliography}
Also, I should note that neither the \usepackage
command nor the \bibliography
commands really accept pathnames as arguments, so using \usepackage{packages/RUMSC}
and \bibliography{bibliography/bib}
is not correct, and not guaranteed to work. If you want things to be found properly, either put them in the same directory as your document, or put them into the appropriate directory in your local texmf
directory. See the following question for more information.
When changing bibliography styles, it's usually a good idea to blow away the .aux
file before recompiling with LaTeX, BibTeX, and LaTeX twice more. (This is especially true when switching from a style, such as plain
, that generates numeric-style citation call-outs to another style that generates authoryear-style call-outs.) In your case, the messages you get from natbib
after switching to natdin
aren't so much error messages as they are warning messages. If you don't delete the aux files first, just hit "r" ("run") all three times when the warning messages are generated, and you'll end up with the correctly formatted entries in the references as well as the correct citation callout style.
Incidentally, the configuration file that goes with the natdin
bibliography style file contains the instruction
\bibpunct{(}{)}{;}{a}{}{,~}
This instruction tells natbib
to use round parentheses (cf the first two arguments) as well as authoryear-style call-outs (the fourth argument) for the citations. Hence, it's actually not necessary to specify the options round
and authoryear
when loading natbib
. Of course, it doesn't hurt to specify the options anyway. It's just that \bibpunct
takes precedence over the options specified when natbib
is loaded.
Here's the output of a program that uses the natdin
style:
Just for comparison, here's the output of the same program when using the plainnat
style -- natbib
's re-implementation of the venerable plain
style -- instead (note that plainnat
, unlike plain
, can generate authoryear-style citation call-outs):
\RequirePackage{filecontents} % make this example self-contained
\begin{filecontents}{xyz.bib}
@article{aa,
author = "Anne Author",
title = "Thoughts",
journal= "Circularity Today",
year = 5678,
volume = 1,
number = 2,
pages = "3-4",
}
\end{filecontents}
\documentclass[12pt,a4paper,twoside,]{article}
\usepackage[margin=2.5cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[authoryear,round]{natbib}
%\bibliographystyle{plainnat}
\bibliographystyle{natdin}
\begin{document}
\cite{aa}
\bibliography{xyz}
\end{document}
Best Answer
bibtex compiles
aux
-files and notbib
-files!This means: If your main file is called
LitReview.tex
and your bib-file is calledMyLibrary.bib
) then the call to bibtex should door
It should not (!) be
or
Side remark: I removed the space from the name of your main file to avoid to have to quote it.