4

The answer to Citing a certain type of reference ... almost perfectly solves my problem, but I would like to have the my cv sorted with continuous counting:

**Articles**
[5] great Article 2
[4] great Article 1

**Presentations**
[3] great Presentation 2
[2] great Presentation 1

**Thesis**
[1] great Thesis
harry
  • 85

1 Answers1

5

Starting with the linked answer you want a single counter and not one for each category. Basically you only need bbx@itemtotal.

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric,sorting=ydnt,defernumbers]{biblatex}

\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}

\makeatletter

% Print labelnumber as actual number, plus item total, minus one
\newrobustcmd{\mkbibdesc}[1]{%
  \number\numexpr\csuse{bbx@itemtotal}+1-#1\relax}

% Increment item total, add entries to categories
\def\bbx@itemtotalcategory#1{%
  \iftoggle{blx@skipbib}{\listbreak}{}%
  \ifentrytype{#1}
    {\csnumgdef{bbx@itemtotal}{\csuse{bbx@itemtotal}+1}%
     \addtocategory{#1}{\thefield{entrykey}}%
     \listbreak}
    {}}
\AtDataInput{\forlistloop{\bbx@itemtotalcategory}{\blx@categories}}
\csnumgdef{bbx@itemtotal}{0}

\makeatother

\DeclareBibliographyCategory{article}
\DeclareBibliographyCategory{report}
\DeclareBibliographyCategory{inproceedings}

\defbibheading{bibliography}{\section*{Publications and Presentations}}
\defbibheading{article}{\subsection*{Journal Articles}}
\defbibheading{report}{\subsection*{Reports}}
\defbibheading{inproceedings}{\subsection*{Presentations}}

\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{aksin,bertram,chiu,companion,padhye,angenendt,moraux}
\printbibheading
\bibbycategory
\end{document}

The same caveats apply here - the approach is suited only for \nocite and requires an extra LaTeX run even if biblatex doesn't tell you one is needed.

StrongBad
  • 20,495