# Biblatex's citesetup and citetext

I am using biblatex to make the citation numbers bold by redefining \citesetup to include a \bfseries:

\renewcommand*{\citesetup}{%
\bfseries
\biburlsetup
\frenchspacing}


This makes the reference \cite{key} appear as

[1]

as desired. The problem is that sometimes I want to use \textcite to also include the author's name, but still with a bold citation number, i.e., the command \textcite{key} should produce

author's name [1]

With my redefined \citesetup this is not achieved since it makes the author's name as well as the citation number bold, i.e.,

author's name [1]

Does anybody know of a good way to achieve the desired effect with a partial bold reference?

-

Here's a solution that redefines the textcite bibmacro (as found in the numeric citestyle), defines a new \mkbibboldbrackets command and applies it to various citation commands (replacing \mkbibbrackets). Note that this way pre- and postnotes still will be typeset in bold.

\documentclass{article}

\usepackage{biblatex}

\makeatletter

\renewbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
{\multicitedelim}
{\cbx@tempa
\ifnameundef{labelname}
{\printfield[citetitle]{labeltitle}}
{\printnames{labelname}}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite}%
\savefield{namehash}{\cbx@lasthash}%
%  \gdef\cbx@tempa{\bibclosebracket\multicitedelim}}% DELETED

\DeclareCiteCommand{\textcite}
{\let\cbx@tempa=\empty
\undef\cbx@lasthash}
{\usebibmacro{citeindex}%
\usebibmacro{textcite}}
{}
{\usebibmacro{postnote}%
%   \bibclosebracket}% DELETED

\newrobustcmd{\mkbibboldbrackets}[1]{%
\begingroup
\blx@blxinit
\blx@setsfcodes
\bfseries\bibopenbracket#1\bibclosebracket
\endgroup}

\makeatother

\DeclareCiteCommand{\cite}[\mkbibboldbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}

\DeclareCiteCommand{\parencite}[\mkbibboldbrackets]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}

\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibboldbrackets\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}

\DeclareMultiCiteCommand{\cites}[\mkbibboldbrackets]{\cite}{\multicitedelim}
\DeclareMultiCiteCommand{\parencites}[\mkbibboldbrackets]{\parencite}{\multicitedelim}
\DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibboldbrackets\mkbibfootnote]{\smartcite}{\multicitedelim}

\begin{document}

Some text about \textcite{companion} and \textcite[see][99]{knuth:ct:a}.

\printbibliography

\end{document}


An alternative that typesets only the label (and not the surrounding brackets) in bold is:

\documentclass{article}

\usepackage{biblatex}

\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{prefixnumber}%
\printfield{labelnumber}%
\ifbool{bbx:subentry}
{\printfield{entrysetcount}}
%      {}}}% DELETED

\begin{document}

Some text about \textcite{companion} and \textcite[see][99]{knuth:ct:a}.

\printbibliography

\end{document}


-
Thanks a lot! That definitely solved my problem :-) –  Robert Mar 25 '12 at 15:48
@Robert Please also upvote my answer -- this has to be done separately from accepting it. –  lockstep Mar 25 '12 at 15:50
Sorry for my late response, lockstep. It has been upvoted now. –  Robert Mar 29 '12 at 19:06