Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a huge document and would like to do the following with biblatex:

  1. Have one (actually, several) seperate bibliography for each chapter.
  2. Add a prefix to each citation number to make them distinguishable.
  3. Have that prefix be the (individual) chapter marker.

This works relatively smoothly for the bibliography itself, but does not work for citations since at the time these marks are generated, the \thechapter variable seems to be zero.

Minimal working example:



    title = {Title},
    author = {Author, Some},
    location = {The City},
    publisher = {Publisher},
    date = {2005}




This~\cite{citation} is a citation.



will give me:

Result of the code

share|improve this question
Welcome to TeX.SX! Well-written question! A tip: You can use backticks ` to mark your inline code as I did in my edit. –  yo' Feb 25 '14 at 13:17
Thanks for the nice welcome, and the helpful tip. I am just getting into biblatex for this huge document, and although very powerful, it is also rather complex for such a widely spread LaTeX project... I'm not even sure this question has an answer. –  Florian Fahrenberger Feb 25 '14 at 13:29
Well, biblatex is a powerful tool for very complicated process. it manages (almost) anything, but that means it can't be simple. Even the reference guide, it's good, but it's completely unreadable (like a reference guide to anything so complicated). –  yo' Feb 25 '14 at 14:35

1 Answer 1

up vote 11 down vote accepted

The problem ist that biblatex doesn't expand fully the argument of prefixnumbers, and so \thechapter gets written literally to the aux file. You could add this to your preamble:

                {\the\c@refsection}{\abx@field@prefixnumber}}}%<-- removed \expandonce

An alternative would be to change the \cite macro so that it doesn't use prefixnumbers but \thechapter:

    \printtext{\thechapter-}% added
    %\printfield{prefixnumber}% removed

In both cases I didn't test what will happen if you have more chapters and if some citations are in more than one chapter.

A third alternativ would be to change the key definition:

  \edef\blx@prefixnumbers{#1}%edef instead of def
          Option 'prefixnumbers' requires global\MessageBreak
share|improve this answer
Thanks a lot, Ulrike. This is a very manual fix, but I understand that biblatex is just (for good reasons) not meant to write directly into the .aux file. All three version as far as I can tell work with several chapters, at least for me. I don't have citations used in more than one chapter though (I seperated them into refsections with seperate .bib files). I will try this in its different variations over the next day. So far, I like version 1 the best, since the \cite command might be overwritten by hyperref or similar. –  Florian Fahrenberger Feb 25 '14 at 13:56
A shorter version for the first strategy is \patchcmd\blx@addprefixnumber{\expandonce\abx@field@prefixnumber}{\abx@field@pr‌​efixnumber}{}{} (of course between \makeatletter and \makeatother) –  egreg Feb 25 '14 at 13:59
Thanks, egreg. Oh, and of course any of these should be in the preamble after \usepackage[...]{biblatex}. :) Just in case this is unclear to future readers. –  Florian Fahrenberger Feb 25 '14 at 14:04
@FlorianFahrenberger: Version 2 didn't change \cite but the bibmacro "cite". This will not interfere with hyperref etc. And biblatex does write directly in the aux-file but it doesn't expand the argument when writing: I don't think that it is really necessary to be so careful. The argument is normally simply a string and so it shouldn't do any harm to expand it. –  Ulrike Fischer Feb 25 '14 at 14:08
@UlrikeFischer Oh, thanks for clearing that up. I seriously did not expect such an expert answer so quickly. Awesome forum! –  Florian Fahrenberger Feb 25 '14 at 14:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.