[Tex/LaTex] \printbibliography is always blank (warnings given)

biberbiblatexbibtexmiktex

I cannot get a bibliography working using biblatex. Even the most basic example doesn't work.

\documentclass{article} 

\usepackage{filecontents}

\begin{filecontents*}{refs.bib}
@BOOK
    {KandR,
     AUTHOR  = "Kernighan, Brian W. and Ritchie, Dennis M.",
     TITLE   = "{The C Programming Language Second Edition}",
     PUBLISHER = "Prentice-Hall, Inc.",
     YEAR = 1988
    }
\end{filecontents*}

\usepackage{biblatex} 
\addbibresource{refs.bib} 

\begin{document} 

Hello \cite{KandR}
\printbibliography 

\end{document}

As far as I can understand, I run the following commands on the file (test1.tex):

pdflatex test1        (This gets some warnings, but ignore)
biber test1
pdflatex test1

biber gives a warning:

WARN - Warning: Found biblatex control file version 2.5, expected version 2.3

The second pdflatex command gives warnings:

LaTeX Warning: Citation 'KandR' on page 1 undefined on input line 20.
LaTeX Warning: Empty bibliography on input line 21.
LaTex Warning: There were undefined references. 

I have tried several things already:

  • Using the bibtex command gives:

    The top-level auxiliary file: test1.aux
    I found no \citation commands---while reading file test1.aux
    I found no \bibdata command---while reading file test1.aux
    I found no \bibstyle command---while reading file test1.aux
    
  • Using [backend=biber] doesn't change anything

Some notes:

  • Windows 8
  • MikTex 2.9
  • TeXworks

Best Answer

I try this code with biber backend. For compiling I use xelatex and UTF format for all files:

\documentclass{article} 

\usepackage{filecontents}
\usepackage[backref=true,                % 
            hyperref=true,               % 
            firstinits=true,             %
            indexing=true,               %
            url=false,                   % 
            style=alphabetic,            %  style=debug, alphabetic
            backend=biber,               % 
            doi=false,
            texencoding=utf8,
            bibencoding=utf8]{biblatex}
\usepackage{hyperref}
\hypersetup{pdfauthor={Your name},
            pdftitle={Your article},
            pdfsubject={My study notes},
            pdfkeywords={linear algebra, math, physics, electronics},
            pdfpagelayout={TwoPageLeft}, % Displays two pages, odd-numbered pages to the left 
            pdfcreator={Xelatex}
            bookmarks={true},            %  A set of Acrobat bookmarks are written
            colorlinks={true},           %  Colors the text of links and anchors. 
            anchorcolor={black},         %  Color for anchor text.
            filecolor={cyan},            %  Color for URLs which open local files.
            menucolor={red},             %  Color for Acrobat menu items.
            runcolor={blue}              %  Color for run links (launch annotations).        
           }           
\addbibresource{refs.bib}    
\usepackage{biblatex} 
\addbibresource{refs.bib} 

\begin{document} 

Hello \cite{KandR}
\printbibliography 

\end{document}

Please check if the file with extension bbl exists and has nonzero size. In case, that this file has zero size or not exist try to create it manually. Use command line and type this:

biber yourexample.bcf
Related Question