Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
Thanks Daniel, it works like a charm! Exactly what I wanted. –  harry Aug 28 '12 at 10:11
    
You don't need two counters here. bbx@count can be replaced with bbx@itemtotal throughout. The patch can be discarded entirely. –  Audrey Aug 28 '12 at 13:02
    
@Audrey yes, I had thought about it a bit more, I could of got rid of one of the "counters". Sorry for stealing and butchering your answer. –  StrongBad Aug 28 '12 at 13:23
1  
I would suggest to change the MWE accordingly to @Audrey in this answer ... –  Kurt Aug 28 '12 at 14:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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