1

I am using following commands for getting the author names in Bold in Bibliography section. This also causes to get the bold author name in citation I am also using some commands to suppress it. But by using following commands I can not suppress the bold letters in citations using the \textcite command. Here is the code I am working with. Please help me to suppress the bold author names in the citation.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=ieee, labeldateparts, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}

\makeatletter
\newbibmacro*{simple:cite}{%
  \printtext[bibhyperref]{%
    \printfield{labelprefix}%
    \printfield{labelnumber}%
    \ifbool{bbx:subentry}
      {\printfield{entrysetcount}}
      {}}}

\newbibmacro*{textcite:init}{%
  \ifnumless{\value{multicitecount}}{2}
    {\global\boolfalse{cbx:parens}}
    {}%
  \global\undef\cbx@lasthash
  \global\undef\cbx@lastyear}

\renewbibmacro*{textcite}{%
   \ifboolexpr{test {\iffieldequals{namehash}{\cbx@lasthash}}
               and test {\iffieldequals{labelyear}{\cbx@lastyear}}}
    {\setunit{\multicitedelim}}
    {\ifnameundef{labelname}
       {\printfield[citetitle]{labeltitle}}
       {\printnames{labelname}}%
     \setunit*{\printdelim{nameyeardelim}}%
     \printlabeldate
     \setunit{\printdelim{namelabeldelim}}%
     \printtext{\bibopenbracket}\global\booltrue{cbx:parens}%
     \stepcounter{textcitecount}}%
  \savefield{namehash}{\cbx@lasthash}%
  \savefield{labelyear}{\cbx@lastyear}%
  \ifnumequal{\value{citecount}}{1}
    {\usebibmacro{prenote}}
    {}%
  \usebibmacro{simple:cite}%
  \setunit{%
    \ifbool{cbx:parens}
      {\bibclosebracket\global\boolfalse{cbx:parens}}
      {}%
    \textcitedelim}}

\DeclareCiteCommand{\textcite}[\cbx@textcite@init\cbx@textcite]
  {\gdef\cbx@savedkeys{}%
   \citetrackerfalse%
   \pagetrackerfalse%
   \DeferNextCitekeyHook%
   \usebibmacro{textcite:init}}
  {\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
     {\protected@xappto\cbx@savedcites{()(\thefield{multipostnote})}%
      \global\clearfield{multipostnote}}
     {}%
   \xappto\cbx@savedkeys{\thefield{entrykey},}%
   \ifboolexpr{test {\iffieldequals{namehash}{\cbx@lasthash}}
               and test {\iffieldequals{labelyear}{\cbx@lastyear}}}
     {}
     {\stepcounter{textcitetotal}}%
   \savefield{namehash}{\cbx@lasthash}%
   \savefield{labelyear}{\cbx@lastyear}}
  {}
  {\protected@xappto\cbx@savedcites{%
     [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}}
\makeatother

%================================[Make author names bold in bibliography but not in citation]============================================



\let\oldciteauthor\citeauthor
%\switchdelim{\addcomma\space}

\renewcommand{\citeauthor}[1]{%
    {%
        \renewcommand{\textbf}{}% suppress bold faced names in the running text
        \switchdelim{\olddelim}%
        \oldciteauthor{#1}%
        \switchdelim{\addcomma\space}%
    }%
}

\renewcommand{\mkbibnamelast}{\textbf}
\renewcommand{\mkbibnamefirst}{\textbf}
\renewcommand{\mkbibnameprefix}{\textbf}
\renewcommand{\mkbibnameaffix}{\textbf}


\begin{document}
\textcite{sigfridsson}

\textcite{knuth:ct:a,knuth:ct:b}

\textcite{knuth:ct:b,knuth:ct:c}

\printbibliography
\end{document}
1
  • Sorry but I don't know how to link the source code. Commented Jun 20, 2018 at 13:58

1 Answer 1

4

Wrap the redefinitions in \AtBeginBibliography

\AtBeginBibliography{%
  \renewcommand{\mkbibnamefamily}{\textbf}%
  \renewcommand{\mkbibnamegiven}{\textbf}%
  \renewcommand{\mkbibnameprefix}{\textbf}%
  \renewcommand{\mkbibnamesuffix}{\textbf}}

The \renewcommand{\citeauthor} is not needed any more. Note how I changed the macro names to the new biblatex-3.3+ forms: Biblatex 3.3 name formatting

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .