I want to obtain different reference lists with reverse numbering order with prefix on the numbers, such as:
Books
[B3] Author, A., "Title1", 2016
[B2] Author, B., "Title2", 2016
[B1] Author, C., "Title3", 2015
Journals
[J2] Author, D., "Title4", 2016
[J1] Author, E., "Title5", 2014
and so on.
I had the following code that worked:
\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{hyperref}
\usepackage[
backend=bibtex,
style=numeric,
firstinits=true,
maxcitenames=99,
maxbibnames=99,
sorting=ydnt,
defernumbers=true,
isbn=false,
]{biblatex}
\addbibresource{publications.bib}
% Definition of asterisk
\newtoggle{bib@asterisk}
\DeclareEntryOption{asterisk}[true]{\settoggle{bib@asterisk}{#1}}
% Reverse ordering for numbers
\AtDataInput{%
\csnumgdef{entrycount:\strfield{prefixnumber}}{%
\csuse{entrycount:\strfield{prefixnumber}}+1}}
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\newrobustcmd*{\mkbibdesc}[1]{%
\number\numexpr\csuse{entrycount:\strfield{prefixnumber}}+1-#1\relax%
\iftoggle{bib@asterisk}%
{\textbf{*}}%
{}%
}
\begin{document}
\nocite{*}
\printbibliography[title={Books},type=books,prefixnumbers={B}]
\printbibliography[title={Journals},type=article,prefixnumbers={J}]
\end{document}
After the last update of biblatex, I have troubles in replicating the same result that I had. Apparently prefixnumbers are deprecated, and they are enforcing me to use biber instead of bibtex.
The new code looks like this:
\documentclass{article}
\usepackage[
backend=biber,
style=numeric,
firstinits=true,
maxcitenames=99,
maxbibnames=99,
sorting=ydnt,
defernumbers=true,
isbn=false,
]{biblatex}
\addbibresource{publications.bib}
\AtDataInput{%
\xifinlistcs{\thefield{entrykey}}{entrylist:\therefsection}{}{%
\listcsxadd{entrylist:\therefsection}{\thefield{entrykey}}%
\csnumgdef{entrycount:\therefsection}{%
\csuse{entrycount:\therefsection}+1}}}
% Print the labelnumber as the total number of entries in the
% current refsection, minus the actual labelnumber, plus one
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\newrobustcmd*{\mkbibdesc}[1]{%
\number\numexpr\csuse{entrycount:\therefsection}+1-#1\relax}
\begin{document}
\nocite{*}
\newrefcontext[labelprefix=B]
\printbibliography[type=book,resetnumbers]
\newrefcontext[labelprefix=J]
\printbibliography[type=article,resetnumbers]
\end{document}
but what I get instead is something like
Books
[B5] Author, A., "Title1", 2016
[B4] Author, B., "Title2", 2016
[B3] Author, C., "Title3", 2015
Journals
[J5] Author, D., "Title4", 2016
[J4] Author, E., "Title5", 2014
Notice that I need also to cite the references, so I cannot use tricks like etaremune or similar. Do you have any idea how to solve this issue?

Books [B3] ... [B2] ... [B1] ...
Journals [J2] ... [J1] ...
and you want to cite them, with the regular \cite command, you get something like [J-3] [C-1].
– aps Sep 13 '16 at 08:59totcountpackage you can get a two-pass solution. (The problem right now is that you count in the bibliography, but if you cite the bibliography hasn't yet been printed and thus the counter doesn't have the right value). – moewe Sep 13 '16 at 09:18totcountpackage – aps Sep 14 '16 at 07:05