1

I would like to use the different citing options of for example natbib, so that I have the \citet and \citep command. However I dont know what type of package I am currently using as I am using a template from github https://github.com/maknesium/latex-vorlage-diplom-bachelor-masterarbeiten. (I guess there is something like a default bibliograpy option?)

I would like to use natbib with the authorname style, but if I import the package and use the option authorname, I get the following error:

Package natbib Error: Bibliography not compatible with author-year citations. 
...and\NAT@force@numbers{}\NAT@force@numbers

As in the various threads on this forum (see natbib error: \providecommand\NAT@force@numbers{}\NAT@force@numbers).

One can reproduce this error wih the template by using natbib without the numbers variable.

Can someone explain to me why the compiler depends on the numbers option?

Edit: I load natbib as follows:

\usepackage[round]{natbib}

It does not seem to matter what bibliographystyle I use, as it alway tells me to use the numbers option.

4
  • Welcome to TeX.SE. It looks like the main test document (Hauptdatei.tex, right?) contains the instruction \bibliographystyle{alphadin}. You need to replace alphadin with a suitable alternative. There are dozens, if not hundreds, of bibliography styles available online that let users create authoryear-style citation call-outs and format the bibliographic entries in various ways. Are you free to choose any style, as long as it generates authoryear-style citation call-outs? A separate issue: you haven't told us how exactly you load the natbib` package; please provide this information.
    – Mico
    Aug 25, 2022 at 13:13
  • @Mico Yes I am free, it needs to resemble APA but I guess any author-year style will do.
    – APA
    Aug 25, 2022 at 13:22
  • Previously I did not load natbib and used \bibliographystyle{apalike-german} and it worked well. My only issue was, that I wanted this brackets () and the option to cite not only as (Jon Doe, 2022) but also as Jon Doe (2022)
    – APA
    Aug 25, 2022 at 13:27
  • You mention that you've tried to load the natbib package with the option authorname. This should have thrown an immediate error, as authorname is not a recognized natbib option. Did you maybe mean to write authoryear? Please clarify.
    – Mico
    Aug 25, 2022 at 16:58

1 Answer 1

1

natbib can operate in two citation modes: authoryear (the default) and numbers.

You can only use all of natbib's features if you use a natbib-compatible \bibliographystyle. Specifically, your style must export the author list and year of the current work in the optional argument of \bibitem. (Some more details can be found in Package natbib Error: Bibliography not compatible with author-year citations (again!).)

If your style is not natbib compatible in this sense, you will still be able to use the style if you load natbib with the numbers option and do not use advanced features like \citet or \citeauthor. The full feature set (authoryear citations, \citet, \citeauthor, ...) will not be available in that case though.


Your template loads

% Festlegung Art der Zitierung - Havardmethode: Abkuerzung Autor + Jahr
\bibliographystyle{alphadin}

which despite the comment would not normally be called a "Harvard style" and is not compatible with natbib.

With that setting you can only use natbib in numbers mode with reduced functionality.

If you want authoryear to work, you need to load a different style. If you have no particular requirements

\bibliographystyle{plainnat}

one of the base natbib styles might suffice.


Note that you may have to delete the .aux and .bbl files after you change your bibliography style, so LaTeX and BibTeX can pick everything up correctly. Otherwise old settings may stay around in these temporary files and can cause error messages that are no longer relevant.


Unless you somehow have to use this particular template, you might want to look for a slightly simpler template elsewhere (or no template at all! just start with a very basic document and load the stuff you need yourself). The code is strewn across so many different files in different folder levels that it is really hard to find out what is going on. The template also does a few things one should not do (it combine a KOMA class with fancyhdr, loads hyperref comparably early, forces a lot of \newpages when a report/scrrprt-like class would start chapters on new pages automatically, wields many \addcontentsline when other more elegant solutions exist, ...).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .