1

I really need your help. I'm new to LaTeX and on start it worked with \cite but when I try now (even with a fresh document), it isn't working like it should. You can see my "fresh test LaTeX file", the bib file and the output below. You guys have any idea? :/

I can choose the book of a suggestion list but then it will output unformatted - just the ID....

Latex Code:

\documentclass{scrartcl}
\bibliography{libary.bib} % with extension
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage{wrapfig}
\usepackage[style=apa,
backend=biber,
bibencoding=utf8,
language=ngerman,
mincitenames=1,
maxcitenames=2]{biblatex}
\usepackage[hidelinks]{hyperref}

\begin{document}
    \cite{BadkeSchaub.2008}
\end{document}

Bib Code:

@book{BadkeSchaub.2008,
 author = {Badke-Schaub, Petra and Hofinger, Gesine and Lauche, Kristina},
 year = {2008},
 title = {Human Factors: Psychologie sicheren Handelns in Risikobranchen},
 url = {http://dx.doi.org/10.1007/978-3-540-72321-9},
 address = {Berlin, Heidelberg},
 publisher = {{Springer Medizin Verlag Heidelberg}},
 isbn = {978-3-540-72321-9},
 doi = {10.1007/978-3-540-72321-9}
}

Output:

BadkeSchaub.2008

moewe
  • 175,683
dessi
  • 11
  • 3
    The \bibliography comes too early. Remove \bibliography{libary.bib} and add \addbibresource{libary.bib} after you load biblatex. You also need to make sure you run Biber (see https://tex.stackexchange.com/q/63852/35864 and https://tex.stackexchange.com/q/154751/35864). – moewe Oct 12 '18 at 09:24
  • oh my god! Thank you mate! You are my lifesaver! – dessi Oct 12 '18 at 09:25
  • With the given preamble you don't need the options bibencoding=utf8, language=ngerman,. Additionally style=apa implements APA style for citations and does not respond to mincitenames=1, maxcitenames=2 as other styles, so it can probably go. – moewe Oct 12 '18 at 09:25

1 Answers1

2

When you use biblatex you need to call \bibliography or \addbibresource after you load biblatex. \bibliography is also defined by standard LaTeX, but biblatex needs to redefine it to work properly, hence it only works properly if it is called after biblatex was loaded.

With biblatex it is recommended to use \addbibresource instead of \bibliography. In general \bibliography should be used without the file extension, \addbibresource with extension. Depending on your TeX distribution or OS it might work otherwise, but that is not guaranteed.

Your current preamble also makes a few of your biblatex options unnecessary, so your document could look like

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[style=apa,
backend=biber]{biblatex}
\usepackage[hidelinks]{hyperref}

\addbibresource{libary.bib} % with extension

\begin{document}
  \cite{BadkeSchaub.2008}
\end{document}
moewe
  • 175,683