[Tex/LaTex] How to debug citations for bibtex

bibtex

I use LaTexila with latexmk and pdflatex and bibtex.

But: Every now and then compiling fails, and obviously due to cites I insert. The following example breaks compilation alltogether, and I have no clue why.

\citep{moebius_2011}

With the following entry in my bib file. The bib entry comes from Zotero.

@book{moebius_2011,
    address = {Wiesbaden},
    title = {Kultur - Theorien der Gegenwart},
    isbn = {3531167758 9783531167756},
    language = {German},
    publisher = {{VS}, Verlag für Sozialwissenschaften},
    author = {Moebius, Stephan},
    year = {2011}
}

If I comment the citation out, everything works.

Here are the relevant document classes:

\documentclass[12pt,a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{jurabib}
\usepackage{pdfpages}
\usepackage{microtype}

Plus the command for the bibliography:

\bibliographystyle{jurabib}

The relevant lines at the error log should be these:

! Missing number, treated as zero.
<to be read again> 
                   \l@German 
l.99   {{Moebius}{Stephan}{S.}{}{}} {} {}
                                          \bibAnnoteFile {moebius_2011}
? 
! Emergency stop.
<to be read again> 
                   \l@German 
l.99   {{Moebius}{Stephan}{S.}{}{}} {} {}
                                          \bibAnnoteFile {moebius_2011}
End of file on the terminal!

Find a full version of the log at this Pastebin link

Best Answer

Your error is that you used German for the language in the bib entry. You have to use a language which babel knows. In your case: german (old spelling) or ngerman (new spelling).

The following MWE compiles for me (please use a similar MWE next time you ask here):

%http://tex.stackexchange.com/questions/84515/how-to-debug-citations-for-bibtex
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{moebius_2011,
  address   = {Wiesbaden},
  title     = {Kultur -- Theorien der Gegenwart},
  isbn      = {3531167758 9783531167756},
  language  = {ngerman},
  publisher = {{VS}, Verlag für Sozialwissenschaften},
  author    = {Moebius, Stephan},
  year      = {2011},
}
\end{filecontents*}

\documentclass[12pt,ngerman]{scrartcl} % paper=a4 Voreinstellung
\usepackage[utf8]{inputenc}
\usepackage{babel}                     % load before jurabib!
\usepackage{jurabib}

\begin{document}

Here is a citation~\cite{moebius_2011}. 
Here is citep~\citep{moebius_2011}.

\bibliographystyle{jurabib}
\bibliography{\jobname}
\end{document}

The hint for finding this error comes from your posted error message, see the part: \l@German. The German comes from the entry for language in your bib file. \l@German is not defined, but \l@german or \l@ngerman are defined as a number. That's the reason for the error message you got: ! Missing number, treated as zero.

As I knew is jurabib not longer maintained so you should think to change to biblatex and biber (already mentioned in the comment of @Timothée Poisot).

Related Question