[Tex/LaTex] How to get sorted and compressed citations when using split bibliography lists and defernumbers=true in biblatex

biblatexbibliographiescitingsortingsplitbib

My reference list is showed in 2 lists based on the entrytype of the bib reference.

I want the lists sorted numerically. Also, I want the citations in a sorted and compressed way. The problem is that I can get only one of them.

When I use biblatex in this way:

\usepackage[style=numeric,citestyle=numeric-comp,sorting=ynt,defernumbers=true,backend=biber]{biblatex}

the citations in the text and the reference lists stay:

With defernumbers=true, but mixed order in citations
When I don't use defernumbers=true it gets:

\usepackage[style=numeric,citestyle=numeric-comp,sorting=ynt,backend=biber]{biblatex}

enter image description here
I have googled a buch of similar issues, but none of them has solved this problem.

If it is a bug in biblatex, I see the only way is citing the references in a manually sorted way, since it looks that the references are being showed in a citation order when I use defernumbers=true.

Is there some charitable soul that could help me in avoiding a lot of time in manually solving this?

MWE with defernumbers=true:

\documentclass{article}
\usepackage[style=numeric,citestyle=numeric-comp,sorting=ynt,defernumbers=true,backend=biber]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{jobname.bib}
    @inproceedings{Kim2010,
    author = {Kim, Duk Sang and Chuc, Nguyen Huu},
    title = {A flexible fingertip tactile sensor},
    year = {2010}
    }
    @article{Yang2010,
    author = {Yang, Y.-J. and Cheng, M.-Y.},
    title = {A 32 x 32 temperature and tactile sensing array using PI-copper films},
    year = {2010}
    }
    @article{Okuyama2012,
    title = {Miniature ultrasonic and tactile sensors for dexterous robot},
    author = {Okuyama, Masanori and Yamashita, Kaoru},
    year = {2012}
    }
    @inproceedings{Bimbo2012,
    author = {J. Bimbo and S. Rodriguez-Jimenez},
    title = {Object pose estimation and tracking by fusing visual and tactile information},
    year = {2012}
    }
\end{filecontents}

\addbibresource{jobname.bib}

\begin{document}

    Citations: \cite{Kim2010,Bimbo2012,Yang2010,Okuyama2012}
    \printbibliography[title={Article}, type=article]
    \printbibliography[title={Inproceedings}, type=inproceedings]

\end{document}

Best Answer

You need to tell biber how to sort the entries, see biblatex - Sort cites via number (split bibliography)

\documentclass{article}
\usepackage[style=numeric,citestyle=numeric-comp,sorting=ynt,defernumbers=true,backend=biber]{biblatex}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
     \pertype{article}
     \step[fieldset=presort, fieldvalue = {A}]
    }
    \map{
      \pertype{inproceedings}
      \step[fieldset=presort, fieldvalue = {B}]
    }
  }
}

\usepackage{filecontents}

\begin{filecontents}{jobname.bib}
    @inproceedings{Kim2010,
    author = {Kim, Duk Sang and Chuc, Nguyen Huu},
    title = {A flexible fingertip tactile sensor},
    year = {2010}
    }
    @article{Yang2010,
    author = {Yang, Y.-J. and Cheng, M.-Y.},
    title = {A 32 x 32 temperature and tactile sensing array using PI-copper films},
    year = {2010}
    }
    @article{Okuyama2012,
    title = {Miniature ultrasonic and tactile sensors for dexterous robot},
    author = {Okuyama, Masanori and Yamashita, Kaoru},
    year = {2012}
    }
    @inproceedings{Bimbo2012,
    author = {J. Bimbo and S. Rodriguez-Jimenez},
    title = {Object pose estimation and tracking by fusing visual and tactile information},
    year = {2012}
    }
\end{filecontents}

\addbibresource{jobname.bib}

\begin{document}

Citations: \cite{Kim2010,Bimbo2012,Yang2010,Okuyama2012}
\printbibliography[title={Article}, type=article]
\printbibliography[title={Inproceedings}, type=inproceedings]

\end{document}

enter image description here