1

I have a document in which the bibliography is splitted via categories. I would like to reference to the elements by numbers [1]. Inside each bibliography, the entries should be sorted by year-name-title (ynt), but the numbers in the first bibliography should be smaller than the numbers in the second one.

MWE:

\documentclass{article}

\usepackage[sorting = ynt,bibstyle=numeric]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
    @book{a,
        author = "I",
        year = "1973"
    }
    @book{a2,
        author = "I",
        year = "1923"
    }
    @book{b,
        author = "You",
        year = "1959"
    }
\end{filecontents}

\addbibresource{\jobname.bib}

\DeclareBibliographyCategory{own}

\begin{document}

\nocite{a,a2}
\addtocategory{own}{a,a2}
\nocite{b}

\printbibliography[category=own,title={A}]
\printbibliography[notcategory=own,title={B}]

\end{document}

Now, the order of the numbers in the bibliography is "[1],[3]" in the first list, and "[2]" in the second list. This looks odd and if there are more items, one has to search through both lists in order to find a reference. I would like to have "[1],[2]" in the first list and "[3]" in the second list.

An option is to add a "presort" key to the corresponding entries in the bib-file, but I would like to not touch the bib-file. Is there, e.g., any possibility to add the "presort" key afterwards in the tex-file? Or can biblatex sort by category (I searched the manual but did not found any clue)?

4
  • It might be cheating, but what about using defernumbers=true? This is even biblatex's recommendation as you can see in the .log file: Package biblatex Warning: Setting 'defernumbers=true' recommended.
    – moewe
    Commented Oct 8, 2015 at 8:17
  • Rather than cheating, this looks like the intended solution. The manual says (§3.12.5) "When using a numeric citation scheme, however, this will most likely lead to discontinuous numbering in split bibliographies. Use the defernumbers package option to avoid this problem." Please post it as an answer.
    – gerw
    Commented Oct 8, 2015 at 8:55
  • When I said cheating, I was referring to the fact that we weren't actually sorting by the category which is, I think, not possible out of the box (AFAIK Biber does not get to see the categories). So I was at least cheating in answering the title question.
    – moewe
    Commented Oct 8, 2015 at 9:13
  • But, it was not my main concern to get the entries sorted via the category, but to get a consistent numbering. So you answered the question I intended to ask ;) I will change the question accordingly.
    – gerw
    Commented Oct 8, 2015 at 9:19

1 Answer 1

3

Follow biblatex's advice in the .log file

Package biblatex Warning: Split bibliography detected.
(biblatex)                Many simple split bibliography setups with
(biblatex)                non-overlapping bibliographies benefit from
(biblatex)                setting 'defernumbers=true'.
(biblatex)                See the documentation for details.
(biblatex)                This warning can be suppressed with
(biblatex)                '\BiblatexSplitbibDefernumbersWarningOff'.

and use defernumbers=true.

edit: This message was removed from a few versions following discussions in https://github.com/plk/biblatex/issues/493, but it is back now.

The biblatex documentation explains on p. 53

In contrast to standard LaTeX, the numeric labels generated by this package are normally assigned to the full list of references at the beginning of the document body. If this option is enabled, numeric labels [...] are assigned the first time an entry is printed in any bibliography.

and notes in §3.12.5 Bibliography Filters and Citation Labels, p. 121, that

The citation labels generated by this package are assigned to the full list of references before it is split up by any bibliography filters. They are guaranteed to be unique across the entire document (or a refsection environment), no matter how many bibliography filters you are using. When using a numeric citation scheme, however, this will most likely lead to discontinuous numbering in split bibliographies. Use the defernumbers package option to avoid this problem. If this option is enabled, numeric labels are assigned the first time an entry is printed in any bibliography.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .