# Biblatex: How to automatically make in-text citations bold with given keyword, within the alpha style?

I need this simple behaviour for citations key using biblatex. I need some references (the ones having a given keyword in the .bib file) to appear with a bold citation key in the text (and possibly also in the printed bibliography).

This question is similar to what was asked in Biblatex: How to automatically make in-text citations bold given a condition? but there, the numeric citation style was used, while I need it with the alpha style.

The required modifications are very similar to the ones in Biblatex: How to automatically make in-text citations bold given a condition?, but the basis for the cite macro is the definition from alphabetic.cbx and not from numeric.cbx. Furthermore, we need to redefine labelalphawidth for the bibliography and not labelnumberwidth.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{libertine}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=alphabetic, backend=biber]{biblatex}
\usepackage{hyperref}

\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{\ifkeyword{important}{\mkbibbold{#1}}{#1}}}

\DeclareFieldFormat{boldimportant}{\ifkeyword{important}{\mkbibbold{#1}}{#1}}

\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printtext[boldimportant]{%
\printfield{labelprefix}%
\printfield{labelalpha}%
\printfield{extraalpha}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
{}}}}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{appleby,
author    = {Humphrey Appleby},
title     = {On the Importance of the Civil Service},
booktitle = {Why We Matter},
date      = {1980},
keywords  = {important},
}
@book{hacker,
author    = {James Hacker},
title     = {The Government},
date      = {1981},
}
\end{filecontents}

• @Raziel That is a but trickier. In general biblatex does not allow you to mix two different styles in one document. But often there are acceptable workarounds. I suggest you ask a new question about this (ideally with a but of background info). – moewe Sep 29 '19 at 14:10