0

I ran into a strange problem while trying to implement a bibliography.

\usepackage[backend=biber,style=alphabetic]{biblatex}
\addbibresource{Quellenverzeichnis.bib}

If style=alphabetic, a bibliography is printed and citations look for exmple like [BJS72]. As I rather want it to be author (year), I thought I need to change the style to "style=authoryear".

But the result is that the in-text citation is the full name of the article and no bibliography is printed. What am I doing wrong?

If it helps I could post my code but thats super long and I figured it might not really help as the only thing I'm changing is the style, I assume in the wrong way.

Thanks

Zehvau
  • 5
  • Welcome! How do you generate the actual bibliography? \printbibliography? Did you compile twice after changing the style? – Taunch Dec 16 '19 at 12:39
  • Yes, I use prinbibliography to generate it. I just found part of the problem, I changed to way of creating the paper to "biblatex" and afterwards ran it again normally. Now the bibliography is display, I just need to change authoryear to something different so that only the first author (+ et. al) and the year in braces is displayed. – Zehvau Dec 16 '19 at 14:23
  • Please ask a separate, new question about the modification of the authoryear style if you need help (after maybe reading the introductory https://tex.stackexchange.com/q/12806/35864 and https://tex.stackexchange.com/q/69028/35864). – moewe Dec 16 '19 at 21:36

1 Answers1

1

When you change the biblatex style option (or citestyle or bibstyle) you should (almost) always rerun the full compilation cycle of LaTeX, Biber, LaTeX, LaTeX.

You should get a warning from biblatex along the lines of

LaTeX Warning: Empty bibliography on input line 13.

[1{C:/Users/Moritz/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (stylechange.aux)

LaTeX Warning: There were undefined references.

Package biblatex Warning: Please (re)run Biber on the file: (biblatex) stylechange (biblatex) and rerun LaTeX afterwards.

that tells you exactly that.


If you change the style=alphabetic in

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=alphabetic]{biblatex}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}

to style=authoryear and run only LaTeX you will not get to see the expected output. You need to run LaTeX, Biber, LaTeX, LaTeX before you can expect to see correct results.

The reason for that is the way Biber passes information on to biblatex via the .bbl file. In order to allow for several different sorting schemes within the same document, the sorting schemes (and other settings, the so-called refcontext) are coded into the data structure in the .bbl file produced by Biber. When one changes the style or certain other options, the refcontext might change causing biblatex to look for data in a different context that isn't there yet. Running LaTeX, Biber, LaTeX, LaTeX tells Biber to generate the required data and lets biblatex read it.

A great explanation of the role of .bbl files can be found at Question mark or bold citation key instead of citation number.


In general it is always a good idea to rerun the full LaTeX, Biber, LaTeX, LaTeX cycle if the bibliography or citations don't behave as expected.

If that is not enough, the second thing to try is to delete the auxiliary files (.aux, .bbl, .bcf, ...) and then recompile with LaTeX, Biber, LaTeX, LaTeX.

moewe
  • 175,683