# Citing a certain type of reference using biblatex

I am in the process of updating my CV using LaTeX. In my CV, I have a list of publications, reports, etc., and I would like to use biblatex to manage these lists. Currently, all of my publications are maintained in a single .bib file, and ideally, I want it to stay this way.

Here is a simple example of how I would like my publications printed in my CV, where the largest labelnumber also equals the total number of references in a particular section:

Publications & Presentations
JOURNAL ARTICLES
[3] Author, A.; Author, B. Journal Article 1 ...
[2] Author, C.; Author, D. Journal Article 2 ...
[1] Author, E.; Author, F. Journal Article 3 ...

REPORTS
[2] Author, G.; Author, H. Report 1 ...
[1] Author, I.; Author, J. Report 2 ...

I can separate the reference types using \defbibfilter and \printbibliography[filter=...]. However, the only way I can get the references to print in the bibliography without a citation is with \nocite{*}. When I use \nocite{*}, all of the references in my .bib file are added to the .bbl file so that the labelnumbers are larger than the actual number of references for a particular type. For example, if there are 8 total references in the .bib file, with 4 articles and 4 reports, the bibliography prints as:

Publications & Presentations
JOURNAL ARTICLES
[8] Author, Author ...
[7] Author, Author ...
[6] Author, Author ...
[5] Author, Author ...

REPORTS
[8] Author...
[7] Author...
[6] Author...
[5] Author...

Is there any way to \nocite only certain types of references in the .bib file? For example, \nocite{type=article}? Or is there another biblatex command that will allow me to cite a particular entry type (article, report, book, etc.) rather than citing with a citation key?

-
Its not completely clear to me what you want to achieve. Do you want consecutive numbers (Journal Articles 1-4, Reports 5-8)? In this case try [defernums=true] in the package options. Or do you want to have numbers start at 1 for each type? In that case try "Bibliography Sections" (§3.5.3 in the manual). –  Daniel Feb 5 '12 at 9:24
–  lockstep Feb 5 '12 at 10:28
–  Ayman Elmasry Feb 5 '12 at 13:19

A descending labelnumber in the bibliography is easy to obtain when entries for the subbibliographies are drawn from separate bib files. The problem is addressed in this post.

Like any citation command, \nocite makes bibliographic data available to biblatex. It can't be limited to entrytype a priori unless you pass a list of entry keys that are entrytype-specific. For example:

\nocite{<articlekey1>, <articlekey2>, <articlekey3>, ...}
...
\nocite{<reportkey1>, <reportkey2>, <reportkey3>, ...}


Descending labelnumber with one bib file can be obtained by making the item counters entrytype-specific. An easy way to perform counting and printing by entrytype is to modify \bibbycategory. The code below demonstrates this approach. It assumes that bibliographic data are made available only via \nocite.

Extensions to flexible category definitions and all citation commands are possible. For an illustration, see this previous answer.

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric,sorting=ydnt,defernumbers=true]{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}

% Initialize category counters
\def\bbx@initcategory#1{\csnumgdef{bbx@count@#1}{0}}
\forlistloop{\bbx@initcategory}{\blx@categories}

% Increment category counters
\def\bbx@countcategory#1{%
\ifentrytype{#1}
{\csnumgdef{bbx@count@#1}{\csuse{bbx@count@#1}+1}%
\listbreak}
{}}
\AtDataInput{\forlistloop{\bbx@countcategory}{\blx@categories}}

% Modify \bibbycategory to set item total
\patchcmd{\blx@bibcategory}
\csnumdef{blx@labelnumber@\the\c@refsection}{0}%
\csnumgdef{bbx@itemtotal}{\csuse{bbx@count@#1}}}
{}{}

\makeatother

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

\begin{document}

@Shanna You're welcome! Much of the code relies on commands from etoolbox. biblatex depends on this package, so we don't need to load it in the preamble. –  Audrey Feb 6 '12 at 14:41
@ros The solution needs an extra latex run. If you have biblatex 2.0 and don't want to use biber as the backend, load biblatex with the option setting backend=bibtex. If this doesn't help, you'll have to provide some details. –  Audrey Jul 23 '12 at 14:44