[Tex/LaTex] Reverse numbering in biblatex bibliography with different categories


I have different categories (filters) for entries in a bibliography using
biblatex (see below). I would like to add a numbering to the entries. Since the
entries are sorted by year in decreasing order, the numbering (in each category)
should also be decreasing.

Basically, I see two routes to go:

1) The first is to use style=numeric and a solution presented here.
However, in my (not so minimal) example, there appeared two problems. First, the
number does not start over again for each of the categories (instead, it
continues). Second, I obtained weird numbers (up to 400), although I only had a
couple of entries with the same keyword.

2) The second (probably easier) I found here. This is actually a nice idea (and lets you specify the numbering etc.), but I
couldn't figure out two things: First, how to get decreasing numbering. Second,
if you have > 9 entries, the space reserved for the label is too small and the
10th entry is not vertically aligned with the 9 before. This can probably be
adjusted with itemindent, but when I tried, the adjustments did not have an


% packages
style=authoryear,% numeric,
sorting=ydnt% sort by year (descending), name, title

% create dummy .bib file
    author={I Me},
    journal={Journal of LaTeX questions},
    title={My first LaTeX problem},

    author={I Me},
    journal={Journal of LaTeX questions},
    title={My second LaTeX problem},

    author={I Me},
    journal={Journal of LaTeX questions},
    title={My third LaTeX problem},

% bibliography settings
\setlength{\bibhang}{1em}% separate bibitems by indentation
\defbibheading{submitted}{\large\sffamily Submitted}% heading
\defbibheading{published}{\large\sffamily Published}% heading
\defbibfilter{submitted}{keyword=submitted}% filter
\defbibfilter{published}{keyword=published}% filter
\addbibresource{mybib.bib}% bibliography data

% % Idea 1) 
% \AtDataInput{%
%   \csnumgdef{entrycount:\therefsection}{%
%     \csuse{entrycount:\therefsection}+1}}
% \DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
% \newrobustcmd*{\mkbibdesc}[1]{%
%   \number\numexpr\csuse{entrycount:\therefsection}+1-#1\relax}

% Idea 2)
{\setlength{\leftmargin}{\bibhang}% => adjustments seem to have no effect
\setlength{\itemindent}{-\leftmargin}% => adjustments seem to have no effect

\printbibliography[heading=submitted, filter=submitted]
\noindent\printbibliography[heading=published, filter=published]

Some more information

1) bibtex as backend is used here on purpose (so that texi2pdf runs biblatex automatically)

2) This problem comes from a CV. The idea is to use \nocite{*} (and not specific \cite{...}s so that I don't have to care about updating the references).

3) In the CV, I show categories "In preparation", "Submitted", "Published", "Book contributions", "Books". I use the following filtering to get this:

\defbibfilter{inpreparation}{type=article and keyword=inpreparation}
\defbibfilter{submitted}{type=article and keyword=submitted}
\defbibfilter{published}{type=article and keyword=published}
\defbibfilter{bookcontrib}{type=incollection and ( keyword=inpreparation or keyword=submitted or keyword=published )}
\defbibfilter{book}{type=book and ( keyword=inpreparation or keyword=submitted or keyword=published )}

Best Answer

The first solution mentioned doesn't work because your bibliography is split by keywords, not by reference sections. The general approach still applies provided that you make the counters keyword-specific.



This format has a few limitations:

  • It only applies to keyword filtering, not more general filters defined via \defbibfilter.
  • The item label width corresponds to \labelnumberwidth. This length is successively increased to accommodate the largest labelnumber based on all entries in the bbl file. So if the keywords filter out many entries, you may find the width too large.

If you don't intend to use the labelnumbers in citations (e.g. entries are accessed only via \nocite), then a simple solution to the above limitations is to patch \printbibligraphy. The following example demonstrates this approach. It also prints entries in the authoryear style.


\defbibfilter{primary}{type=article and keyword=primary}
\defbibfilter{other}{not type=article and not type=manual and not keyword=secondary}




  author = {Glashow, Sheldon},
  title = {Partial Symmetries of Weak Interactions},
  journaltitle = {Nucl.~Phys.},
  volume = {22},
  date = {1961},
  pages = {579--588},
  keywords = {stdmodel,primary}}
  author = {Weinberg, Steven},
  title = {A Model of Leptons},
  journaltitle = {Phys.~Rev.~Lett.},
  volume = {19},
  date = {1967},
  pages = {1264--1266},
  keywords = {stdmodel,primary}}
  author = {Salam, Abdus},
  editor = {Svartholm, Nils},
  title = {Weak and Electromagnetic Interactions},
  booktitle = {Elementary particle theory},
  booktitleaddon = {Proceedings of the Eighth Nobel Symposium},
  location = {Stockholm},
  date = {1968},
  pages = {367--377},
  keywords = {primary,stdmodel}}
  author = {Augustine, Robert L.},
  title = {Heterogeneous catalysis for the synthetic chemist},
  publisher = {Marcel Dekker},
  location = {New York},
  date = {1995},
  keywords = {secondary}}
  title = {Information Theory and Statistics},
  author = {Kullback, Solomon},
  year = {1959},
  publisher = {John Wiley \& Sons},
  location = {New York}}

\printbibliography[filter=primary,title={Primary articles}]
\printbibliography[filter=secondary,title={Secondary works},resetnumbers]
\printbibliography[filter=other,title={Other works},resetnumbers]