4

Simple question, but I can't seem to figure it out.

I use biblatex/biber and use several bibliographies for different document types in my document (e.g. one for articles and books, misc for legal documents).The problem is that I can't seem to get to sort one specific bibliography by year("ynt"), while another still needs to be sorted "nyt".

How do I make the documents of only one bibliography sort primarily by year?

A MWE:

\documentclass{article}
\usepackage[autocite=footnote, language=german, style=authoryear-ibid, sorting=nyt, backend=biber]{biblatex}

\usepackage[bottom]{footmisc}
\bibliography{lit.bib}
\makeindex
\begin{document}

test\autocites[]{test1}[]{test2}[]{test3}[]{test4}

\printbibliography[title={Literatur}, type=book] %this is articles and books, which needs to be sorted NYT
\printbibliography[title={Deutsche Rechtsquellen und Gesetzmaterialien}, type=misc] %this is legal documents, which needs to be sorted YNT.
\end{document}

With the following lit.bib

@book{test1,
    Author = {{Karl Marx}},
    Title = {Capital},
    Year = {1867}}

@book{test2,
    Author = {Calliess, Christian and Ruffert, Matthias},
    Title = {Kommentar zum EUV/EGV},
    Year = {2007}}

@misc{test3,
    Author = {{BT-Drs. 9/743}},
    Howpublished = {Bundestagsdrucksache 1},
    Year = {1981}}

@misc{test4,
    Author = {{BT-Drs. 9/735}},
    Howpublished = {Bundestagsdrucksache 2},
    Year = {1985}}

The result can be seen here:

enter image description here

The "Literatur" is correctly sorted (by authorname), but I need the other bibliography to be sorted by year. Changing the sorting globally does not help, as I need distinct sorting only for legal documents. Removing the global sorting option and introducing local sorting options did not work, however. What am I doing wrong?

  • 4
    Have you tried to change sorting=nyt to sorting=ynt? Year Name Title)? – Mensch Jun 16 '16 at 22:01
  • thanks for the input! it does work, but is not a solution to my problem. i updated my initial post to cover the entire issue, maybe the problem becomes clearer? – kuuhkuuh Jun 18 '16 at 18:37
  • 3
    Please add a minimal document and a couple of sample .bib entries to your question. Posting the output is not particularly helpful here, since we need to see what your .bib entries are like. To see how to do this for a bibliography question like yours see minimal working example with bibliography (MWEB). – Alan Munn Jun 18 '16 at 18:40
  • Thanks for the hint. I changed it again, now it should work and all be clear. – kuuhkuuh Jun 18 '16 at 22:00
4

Recent version of biblatex removed the sorting option from \printbibliography and move it to \refcontext. Thus you have to add the \refcontexts for the bibliography you want to display.

Accordingly, the MWE should look like

\documentclass{article}
\usepackage{filecontents}
@book{test1,
    Author = {{Karl Marx}},
    Title = {Capital},
    Year = {1867}}

@book{test2,
    Author = {Calliess, Christian and Ruffert, Matthias},
    Title = {Kommentar zum EUV/EGV},
    Year = {2007}}

@misc{test3,
    Author = {{BT-Drs. 9/743}},
    Howpublished = {Bundestagsdrucksache 1},
    Year = {1981}}

@misc{test4,
    Author = {{BT-Drs. 9/735}},
    Howpublished = {Bundestagsdrucksache 2},
    Year = {1985}}  
\end{filecontents}


\usepackage[autocite=footnote, language=german, style=authoryear-ibid, sorting=nyt, backend=biber]{biblatex}

\usepackage[bottom]{footmisc}
\bibliography{\jobname.bib}
\makeindex
\begin{document}

test\autocites[]{test1}[]{test2}[]{test3}[]{test4}

\newrefcontext[sorting=nyt]
\printbibliography[title={Literatur}, type=book] %this is articles and books, which needs to be sorted NYT

\newrefcontext[sorting=ydnt]
\printbibliography[title={Deutsche Rechtsquellen und Gesetzmaterialien}, type=misc] %this is legal documents, which needs to be sorted YNT.
\end{document}

enter image description here

  • Removing a bunch of misplaced backslashes in your code and changing the key answer and sorting style to "\newrefcontext[sorting=nyt]" worked for me! Thanks! – kuuhkuuh Jun 18 '16 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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