biblatex - Consistent numbering in split bibliographies












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)?










share|improve this question

























  • 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 at 9:19
















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)?










share|improve this question

























  • 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 at 9:19














1












1








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)?










share|improve this question
















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)?







biblatex






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 14 '16 at 20:20









Arzigoglu

1,3051517




1,3051517










asked Oct 8 '15 at 7:51









gerwgerw

361110




361110













  • 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 at 9:19



















  • 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 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
    Oct 8 '15 at 9:19

















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
Oct 8 '15 at 8:17





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
Oct 8 '15 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
Oct 8 '15 at 8:55







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
Oct 8 '15 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
Oct 8 '15 at 9:13







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
Oct 8 '15 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
Oct 8 '15 at 9:19





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
Oct 8 '15 at 9:19










1 Answer
1






active

oldest

votes


















2














Follow biblatex's advice in the .log file



Package biblatex Warning: Setting 'defernumbers=true' recommended.


and use defernumbers=true.



edit: Newer versions of biblatex do not recommend defernumbers in the .log file any more following https://github.com/plk/biblatex/issues/493. In most cases it is still a very good idea to use defernumbers with split numeric bibliographies.



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.







share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f271751%2fbiblatex-consistent-numbering-in-split-bibliographies%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Follow biblatex's advice in the .log file



    Package biblatex Warning: Setting 'defernumbers=true' recommended.


    and use defernumbers=true.



    edit: Newer versions of biblatex do not recommend defernumbers in the .log file any more following https://github.com/plk/biblatex/issues/493. In most cases it is still a very good idea to use defernumbers with split numeric bibliographies.



    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.







    share|improve this answer






























      2














      Follow biblatex's advice in the .log file



      Package biblatex Warning: Setting 'defernumbers=true' recommended.


      and use defernumbers=true.



      edit: Newer versions of biblatex do not recommend defernumbers in the .log file any more following https://github.com/plk/biblatex/issues/493. In most cases it is still a very good idea to use defernumbers with split numeric bibliographies.



      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.







      share|improve this answer




























        2












        2








        2







        Follow biblatex's advice in the .log file



        Package biblatex Warning: Setting 'defernumbers=true' recommended.


        and use defernumbers=true.



        edit: Newer versions of biblatex do not recommend defernumbers in the .log file any more following https://github.com/plk/biblatex/issues/493. In most cases it is still a very good idea to use defernumbers with split numeric bibliographies.



        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.







        share|improve this answer















        Follow biblatex's advice in the .log file



        Package biblatex Warning: Setting 'defernumbers=true' recommended.


        and use defernumbers=true.



        edit: Newer versions of biblatex do not recommend defernumbers in the .log file any more following https://github.com/plk/biblatex/issues/493. In most cases it is still a very good idea to use defernumbers with split numeric bibliographies.



        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.








        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 16 at 13:47

























        answered Oct 8 '15 at 9:18









        moewemoewe

        94.9k10115358




        94.9k10115358






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f271751%2fbiblatex-consistent-numbering-in-split-bibliographies%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?