# biblatex: separate bibliographies based on type, with separate counters

I'm trying to make a publication list where all my publications (in a .bib file) are shown (most recent first), divided by type (article, thesis, book etc.). For now, I came up with something that more or less works, except that the counter is shared between all the different bibliographies, see the following picture.

I would like the counters in Articles to be [1], [2], ... and then the counters in Books to reset and be [1], [2], ... and so forth.

The code for the MWE above is the following:

\documentclass{article}
\usepackage[sorting=ymdnt, backend=biber]{biblatex}
\DeclareSortingScheme{ymdnt}{
\sort{
\field{presort}
}
\sort[final]{
\field{sortkey}
}
\sort[direction=descending]{
\field[strside=left,strwidth=4]{sortyear}
\field[strside=left,strwidth=4]{year}
\literal{9999}
}
\sort[direction=descending]{
\field{month}
\literal{9999}
}
\sort{
\field{sortname}
\field{author}
\field{editor}
\field{translator}
\field{sorttitle}
\field{title}
}
\sort{
\field{sorttitle}
\field{title}
}
}

\usepackage{filecontents}
\begin{filecontents}{references.bib}
@book{knuth1986texbook,
keywords = {book},
title={The texbook},
author={Knuth, D.E. and Bibby, D.},
volume={1993},
year={1986},
}
@article{knuth1977fast,
keywords = {article},
title={Fast pattern matching in strings},
author={Knuth, D.E. and Morris Jr, J.H. and Pratt, V.R.},
journal={SIAM journal on computing},
volume={6},
number={2},
pages={323--350},
year={1977},
publisher={SIAM}
}
@article{doe2001,
keywords = {article},
title={Whatever},
author={Doe, John},
journal={SIAM journal on computing},
volume={6},
number={2},
pages={323--350},
year={2001},
publisher={SIAM}
}
\end{filecontents}
\begin{document}
\nocite{*}
\printbibliography[type=article,title=Articles]
\printbibliography[type=book,title=Books]
\end{document}

• While not an exact duplicate, you should be able to adjust this answer to do something similar for your case. Basically you define additional counters that count separately the Book and Articles, and then patch the label to display those counters instead. Sep 19 '19 at 15:27

You need two things: (1) The global defernumbers (package) option and (2) locally (for each \printbibliography) the option resetnumbers.

Of course this means the labels are highly non-unique and can not be used to cite the entries, but you are no doubt aware of this.

\documentclass{article}
\usepackage[sorting=ydnt, backend=biber, defernumbers]{biblatex}


I simplified the MWE to make it more compact and to make it easier to focus on the important things. But please note that in more recent versions of biblatex the command \DeclareSortingScheme is now called \DeclareSortingTemplate. The old name still works, but generates a warning.