# labelprefix to newrefcontext replacing prefixnumbers to printbibliography not working

After updating biblatex of MikTex 2.9 I get the following error message when using:

\printbibliography[prenote=conference, keyword=C, prefixnumbers={C}]


Package biblatex Warning: prefixnumbers option to \printbibliography is no longer supported, use 'labelprefix' option to \newrefcontext.

%...
\newrefcontext[labelprefix=C]
\printbibliography[prenote=conference, keyword=C]


I get the following error message (line 17 being the \printbibliography...):

LaTeX Warning: Empty bibliography on input line 17.

Here is a complete minimal working example with both variants (one is commented out):

\documentclass[11pt, a4paper, twoside, cleardoublepage=plain, openright]{scrbook}

\usepackage{filecontents}
\begin{filecontents}{references.bib}
@inproceedings{test-conference,
author = {Test Author 1},
title = {Test Title 1},
booktitle = {Test Booktitle 1},
year = {2016},
keywords = {C}
}
@inproceedings{test-workshop,
author = {Test Author 2},
title = {Test Title 2},
booktitle = {Test Booktitle 2},
year = {2016},
keywords = {W}
}
\end{filecontents}

\usepackage[style=ieee, backend=bibtex, bibencoding=ascii, defernumbers=true, maxnames=10]{biblatex}

\begin{document}

Conference paper: \cite{test-conference}
Workshop paper: \cite{test-workshop}.

\defbibnote{conference}{Conference Papers}
\defbibnote{workshop}{Workshop Papers}

% #### Variant 1 ####
% ## Producing error: Package biblatex Warning: prefixnumbers option to \printbibliography is no longer supported, use 'labelprefix' option to \newrefcontext.
% ## Generating output with bibliography but without C or W as prefix.
\printbibliography[prenote=conference, keyword=C, prefixnumbers={C}]
\printbibliography[prenote=workshop, keyword=W, prefixnumbers={W}]

% #### Variant 2 ####
% ## Producing error: LaTeX Warning: Empty bibliography on input line ...
% ## Generating output completely without bibliography.
% \newrefcontext[labelprefix=C]
% \printbibliography[prenote=conference, keyword=C]
% \newrefcontext[labelprefix=W]
% \printbibliography[prenote=workshop, keyword=W]

\end{document}


What am I missing?

UPDATE: Thanks to Guido's advise, it (almost) works after I changed the backend option to biber as shown below. I now get the bibliographies with the prefixes as desired. However, in the document where I cite the references, I get [0] instead of [C1] or [W1], respectively. Interestingly, there is no error message or warning from pdflatex during compilation.

\usepackage[style=ieee, backend=biber, bibencoding=ascii, defernumbers=true, maxnames=10]{biblatex}

\begin{document}

Conference paper: \cite{test-conference} should be [C1] but is [0].
Workshop paper: \cite{test-workshop} should be [W1] but is [0].

\defbibnote{conference}{Conference Papers}
\defbibnote{workshop}{Workshop Papers}

\newrefcontext[labelprefix=C]
\printbibliography[prenote=conference, keyword=C]
\newrefcontext[labelprefix=W]
\printbibliography[prenote=workshop, keyword=W]

\end{document}


What's causing this?

• Welcome to TeX.SX! Would it be possible to provide the code of a full example document that shows the problem (an MWE)? It will be much easier for us to diagnose your problem if you show us a full document that causes the error and not just a few snippets. – moewe Jun 30 '16 at 15:27
• Thanks for the warm welcome! I just added an MWE that is hopefully helping to figure out what is wrong. – Linus Jul 1 '16 at 10:13
• prefixnumber is no longer supported, and you have to change to labelprefix option of refcontext. It seems to me that refcontexts are not supported by the bibtex backend, so you have switch to biber as backend. When you do, it seems there is a problem with the ieee style. – Guido Jul 1 '16 at 10:51
• Thanks Guido! Changing the backend to biber did in fact help! I could not reproduce what you maybe encountered as problems with the ieee style... However, now the citations in the document do not get the respective labels but only [0], as I have shown in the update in the bottom of my original post. – Linus Jul 1 '16 at 12:44

The MWE

\documentclass{article}

\usepackage[style=ieee, backend=biber, defernumbers=true, maxnames=10]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{test-conference,
author    = {Test Author 1},
title     = {Test Title 1},
booktitle = {Test Booktitle 1},
year      = {2016},
keywords  = {C},
}
@inproceedings{test-workshop,
author    = {Test Author 2},
title     = {Test Title 2},
booktitle = {Test Booktitle 2},
year      = {2016},
keywords  = {W},
}
\end{filecontents}

\begin{document}
Conference paper: \cite{test-conference}
Workshop paper: \cite{test-workshop}.

\defbibnote{conference}{Conference Papers}
\defbibnote{workshop}{Workshop Papers}

\newrefcontext[labelprefix=C]
\printbibliography[prenote=conference, keyword=C]
\newrefcontext[labelprefix=W]
\printbibliography[prenote=workshop, keyword=W]
\end{document}


produces the desired and expected output

But you will have to use Biber instead of BibTeX, because only Biber supports labelprefix properly. (Starting with biblatex 3.13 a rudimentary version of labelprefix is supported even with the BibTeX backend, but there are some differences to the proper/full implementation available with Biber, see https://github.com/plk/biblatex/issues/852. In general you can only use all of biblatex's features with Biber, so it is a very good idea to switch to Biber anyway.)

Since this MWE needs to use defernumbers it may happen that the citation numbers get stuck at "[0]" or in a different unwanted numbering. In those cases it helps to remove the temporary files (.aux, .bbl, .bcf, ...) and recompile from scratch.

In very specific situations you may have to have to make sure that the entries belong to the correct refsection even in the citations. Usually this should not be needed, though.

Then you would use \assignrefcontextkeyws to make sure the citations get it right. See §3.7.10 Reference Contexts of the biblatex documentation, especially pp. 94-99.

• Thanks for this solution! That this is only necessary for biblatex-ieee is indeed interesting. At least now I know how to solve it. – Linus Jul 4 '16 at 13:12

This should just work as is. The labels in citations pick up the label in the last bibliography in which the reference was printed, by default. This is almost always what you want and with this MWE, it works fine for me. Perhaps a problem with the ieee style?

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{references.bib}
@inproceedings{test-conference,
author = {Test Author 1},
title = {Test Title 1},
booktitle = {Test Booktitle 1},
year = {2016},
keywords = {C}
}
@inproceedings{test-workshop,
author = {Test Author 2},
title = {Test Title 2},
booktitle = {Test Booktitle 2},
year = {2016},
keywords = {W}
}
\end{filecontents}

\usepackage[style=numeric, bibencoding=ascii, defernumbers=true, maxnames=10]{biblatex}

\begin{document}

Conference paper: \cite{test-conference}
Workshop paper: \cite{test-workshop}.

\defbibnote{conference}{Conference Papers}
\defbibnote{workshop}{Workshop Papers}

\newrefcontext[labelprefix=C]
\printbibliography[prenote=conference, keyword=C]
\newrefcontext[labelprefix=W]
\printbibliography[prenote=workshop, keyword=W]

\end{document}


• I tried to run your code but I get an error : "Undefined control sequence [...] \newrefcontext". Am I missing something here ? Could there have been a modification of the biblatex package ? – Alain Aug 3 '16 at 16:39
• What version of biblatex are you using? \newrefcontext has been around for a while now. – PLK Aug 3 '16 at 21:14
• I have tried Texlive 2014 and 2016. I have been investigating more on this issue, it seems related to my Linux distribution (Fedora 23/24). Indeed, code compiles just fine under Linux Mint with Texlive 2015 and 2016... – Alain Aug 4 '16 at 15:33
• Why \defbibnote{conference}{Conference Papers} \defbibnote{workshop}{Workshop Papers} solves the referencing problem?? – João Henriques Jan 17 at 20:00