I need to do this for a massive report, in which in each section some references should be bolded.
The weird thing is that, if this code is present in the main .tex doc's preamble, after printing the bibliography, the formatting of the paragraphs is shot. There is no indent anymore at the beginning of paragraphs and the page margin is smaller.
I haven't built a minimal example yet, but perhaps I forgot to close something obvious in this code?
\usepackage{etoolbox} % for \apptocmd
% At the start of every bib item: if keyword “bold” is present, begin a group and switch to bold
\AtEveryBibitem{%
\ifkeyword{bold}{\begingroup\bfseries}{\begingroup}%
}
% At the end of every bib item, append an \endgroup to close the group.
\apptocmd{\finentry}{%
\ifkeyword{bold}{\endgroup\bfseries}{\endgroup}%
}{}{}