# Highlighting particular bibliography entries

I'm trying to create a bibliography in which certain items are highlighted as being more important. Ideally this would put an asterisk at the front of that particular item while leaving the sorting unchanged. I'm using biblatex-chicago with Biber as the backend.

Say I have these two entries in my .bib file:

@article{cite1,
author = {Knuth, Donald},
title = {{Title One}},
journal = {Some Journal},
year = {2005},
volume = {1},
pages = {1--42},
}

@book{cite2,
author = {Knuth, Donald},
title = {{A Way More Important Title}},
publisher = {Oxford},
year = {2009},
}


What I'd like to do is highlight the second one so that the sort order and repeated name dash stays unchanged. Ideally it would produce something like this:

Knuth, Donald. 2005. "Title One." Some Journal 1: 1-42.

*———. 2009. A Way More Important Title. Oxford: New York.

Is there some way to achieve this? Some additional key I could put in the important entries, perhaps? I've tried faking the name (like name = {*Knuth, Donald}, sortname = {Knuth, Donald}), but that breaks the 3-em dash replacement.

• Oops, I didn't notice the asterisk as the means for highlighting. Is that the preferred output? – jon Dec 12 '13 at 22:57

Here's an easy way:

\documentclass[12pt]{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{cite1,
author = {Knuth, Donald},
title = {{Title One}},
journal = {Some Journal},
year = {2005},
volume = {1},
pages = {1--42},
}

@book{cite2,
author = {Knuth, Donald},
title = {{A Way More Important Title}},
publisher = {Oxford},
year = {2009},
}
\end{filecontents}

\usepackage[T1]{fontenc}
\usepackage{biblatex-chicago}

%% Highlight entries
\usepackage[svgnames]{xcolor}
\DeclareBibliographyCategory{important}
% the colour definition
\colorlet{impentry}{Maroon}% let 'impentry' = Maroon

% Inform biblatex that all books in the 'important' category deserve
% special treatment, while all others do not
\AtEveryBibitem{%
\ifcategory{important}%
{\bfseries\color{impentry}}%
{}%
}

% Add books to 'important' category in preamble
cite2,
}

\begin{document}

\nocite{*}
\printbibliography

\end{document}


A trickier way would be to use biber's \DecareSourcemap command (documented in biblatex manual) to essentially grep for a keyword in the keywords field and then act accordingly. One advantage of this method is that it means the 'initialization' is put in the .bib file rather that needing to declare new bibliography categories and so on. (You also get to re-write the bibliography output on the fly, so you could have only [say] an addendum field that is highlighted.)

There might also be reason to create other useful commands like an \addncite, which \cites the entry and adds it at the same time to this new 'important' category. Not sure what your overall needs are, however.

• Beautiful. \AtEveryBibitem was what I needed. Adding things to categories works fine for what I need, and I was able to get an asterisk before with the command \AtEveryBibitem{\ifcategory{important}{* }{}}. – user42659 Dec 13 '13 at 0:03
• @user42659 -- Ah, OK. Glad it works. – jon Dec 13 '13 at 0:41
• @jon I suspect it only works with biblatex, doesn't it ? Is biber strictly required ? – Vincent Fourmond Oct 5 '15 at 8:38
• @VincentFourmond -- The answer explicitly relies on biblatex in this case, but Biber is not required. However, \DeclareSourcemap is a Biber-specific command. – jon Oct 6 '15 at 0:06
• @jon Thanks. I have been considering switching to biblatex for a while, this looks like yet another good argument to do so... – Vincent Fourmond Oct 6 '15 at 7:00