1

I am using biblatex to manage some section-by-section bibliography. I need to print in some sections of my documents, specific individual bibliography entries all in bold. How can I achieve this?

Currently my MWE looks as:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex,
            maxnames = 3,
            firstinits=false,
            uniquename=init,
            autocite=superscript,
            style=nature,
            articletitle=false,
            natbib=true,
            defernumbers=true]{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document}

\newrefsection
\section{First section}
I am citing \autocite{angenendt,westfahl:space} and both entries will appear in the same style in my section bibliography.

\printbibliography

\newrefsection
\section{Second section}
Now I am citing again \autocite{angenendt} and \autocite{westfahl:space}, but I would like \autocite{angenendt} to be typed in bold in the bibliography this time...

\printbibliography    

\end{document}
  • How do you plan to identify the bold entries? And do you want the entire entry in the bibliography bold, or just the numbers? – moewe Feb 12 '17 at 16:52
  • @moewe Good point. In fact I was thinking about redefining a special citation command that somehow is going to tell \printbibliography to print the entry in bold, as I don't want to add duplicate entries in the bib file that just have \textbf{} for all fields. The idea would be to use \DeclareCiteCommand. But I am missing how to link to the bibliography entry rather than to the citation. And yes, the whole entry should be in bold. But actually not necessarily the numbers. – maurizio Feb 12 '17 at 16:56
4

Since in your other question (Biblatex: Changing number of authors listed in bibliography only for one section) we used toggles to such a great extent, why not go for it again?

\newtoggle{bbx:boldentries}
\DeclareBibliographyCategory{boldentry}
\AtEveryBibitem{\ifboolexpr{togl {bbx:boldentries} and test {\ifcategory{boldentry}}}{\bfseries}{}}

We define a 'bibliography category' boldentry, all entries that you want in bold can be added to that category with

\addtocategory{boldentry}{<citekey>}

Just issue \toggletrue{bbx:boldentries} before \printbiblioagrphy if you want the entries marked to be bolded in bold.

MWE

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex,
            maxnames = 3,
            firstinits=false,
            uniquename=init,
            autocite=superscript,
            style=nature,
            articletitle=false,
            natbib=true,
            defernumbers=true]{biblatex}
\addbibresource{biblatex-examples.bib}

\newtoggle{bbx:boldentries}
\DeclareBibliographyCategory{boldentry}
\AtEveryBibitem{\ifboolexpr{togl {bbx:boldentries} and test {\ifcategory{boldentry}}}{\bfseries}{}}

\begin{document}
\newrefsection
\section{First section}
I am citing \autocite{angenendt,westfahl:space} and both entries will appear in the same style in my section bibliography.

\printbibliography

\newrefsection
\section{Second section}
\addtocategory{boldentry}{angenendt}
\toggletrue{bbx:boldentries}
Now I am citing again \autocite{angenendt} and \autocite{westfahl:space}, but I would like \autocite{angenendt} to be typed in bold in the bibliography this time...

\printbibliography    
\end{document}

enter image description here

  • Excellent. This toggling strategy is awesome. Side question (maybe to post as a standalone in case): where do I find a list of all macros of the type bbx:<command>? As well as where the togl and test commands in your definition come from? – maurizio Feb 12 '17 at 17:09
  • @maurizio togl and test come from etoolbox, refer to pp. 23-27 of the etoolbox documentation. The bbx: toggles are mostly defined in the .bbx files (standard.bbx, nature.bbx), but there are actually not that many of them. The toggles used in my answers are defined from scratch and don't appear anywhere else. – moewe Feb 12 '17 at 17:13
  • I am not familiar with the 'u'... Tell me how I can do it. – maurizio Feb 12 '17 at 17:14
  • oh ok. I thought it was automatic. Sorry about it. – maurizio Feb 12 '17 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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