0

I'm trying to manipulate my bibliography using biber. I want authors and years to be printed completely in bold face. However, I could only make names (and prefixes etc.) bold but could not figure out how to do the same thing with the "and"s between authors' names. I got the same problem with the year of publication.

This is what I did so far:

\usepackage[backend=biber,
style=authoryear,
citestyle=apa]{biblatex}
\addbibresource{mybib.bib}
....
\begingroup
\setlength\bibitemsep{10pt}
\renewcommand{\labelnamepunct}{\addcolon\space}
\renewcommand*{\mkbibnamefamily}[1]{\textbf{#1}}
\renewcommand*{\mkbibnamegiven}[1]{\textbf{#1}}
\renewcommand*{\mkbibnameprefix}[1]{\textbf{#1}}
\renewcommand*{\mkbibnamesuffix}[1]{\textbf{#1}}
\printbibliography 
\addcontentsline{toc}{chapter}{Bibliography}
\endgroup    

I would be so glad if somebody could help me here!

Edit: For the sake of completeness, I already found a solution to print the year (and parantheses around it) in bold type:

\DeclareFieldFormat{parens}{\bfseries{\mkbibparens{#1}}} 
\DeclareFieldFormat{date}{\bfseries{#1}} 

1 Answers1

1

In your preamble, add these lines

\DeclareNameAlias{sortname}{given-family-bold}
\DeclareNameFormat{given-family-bold}{\mkbibbold{%
  \ifgiveninits
    {\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiveni}
{\namepartprefix}{\namepartsuffix}}
    {\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiven}
{\namepartprefix}{\namepartsuffix}}%
  \usebibmacro{name:andothers}}}

The MWE

\documentclass[12pt,a4paper]{report}
\usepackage{lipsum}
\usepackage[backend=biber,style=authoryear,citestyle=apa]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{test1,
author    = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title     = {The LaTeX Companion},
publisher = {Addison-Wesley},
location  = {Reading, Mass.},
year      = {1994},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\DeclareNameAlias{sortname}{given-family-bold}

\DeclareNameFormat{given-family-bold}{\mkbibbold{%
  \ifgiveninits
    {\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiveni}{\namepartprefix}{\namepartsuffix}}
    {\usebibmacro{name:given-family}{\namepartfamily}{\namepartgiven}{\namepartprefix}{\namepartsuffix}}%
    \usebibmacro{name:andothers}}}

\begin{document}
\chapter{Test}
Test paragraph, just random words \parencite{test1}. \lipsum[1-2]

\setlength\bibitemsep{10pt}
\printbibliography 

\end{document}

As the OP wants the bibliography to be sorted lastname, firstname, firstname lastname and firstname lastname, as @moewe pointed out in https://tex.stackexchange.com/a/178877/35864 -- these lines should go in the preamble.

\DeclareNameAlias{sortname}{family-given/given-family-bold}
\DeclareNameFormat{family-given/given-family-bold}{\mkbibbold{%
  \ifnumequal{\value{listcount}}{1}
    {\ifgiveninits
      {\usebibmacro{name:family-given}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefix}
        {\namepartsuffix}}
      {\usebibmacro{name:family-given}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}}%
      \ifboolexpe{%
        test {\ifdefvoid\namepartgiven}
        and
        test {\ifdefvoid\namepartprefix}}
      {}
      {\usebibmacro{name:revsdelim}}}
    {\ifgiveninits
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefix}
        {\namepartsuffix}}
      {\usebibmacro{name:given-family}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}}}%
      \usebibmacro{name:andothers}}}
  • Thanks for your help! The problem is (thats why I included all the other command only right before my bibliography) that using this command makes all the "and"s in my citations bold. My citations should have a regular typeface while my bibliography should show bold authors and years – Jonathan Sep 04 '17 at 09:41
  • I did not check the citation. I edited the answer. It should make the authors and the "and" string bold on bibliography but not on the citation. – M. Ridha Siregar Sep 04 '17 at 10:44
  • Use \parencite{foo} instead of (\cite{foo}) – moewe Sep 04 '17 at 12:23
  • @moewe Absolutely, parencite gives the parentheses :-) – M. Ridha Siregar Sep 04 '17 at 12:46
  • Thanks a lot again, it nearly looks how I imagined it now! Just one last thing, is there a simple way to not change the ordering of given and family names of authors? Before, the ordering for the first author was "lastname, firstname", for following authors "firstname lastname". Thats how I want it to look like. Your code however makes all authors' names look like "firstname lastname" (or the other way around if we change "given" and "family"). I tried to split the code between the first author's name and all the following authors' names but could not make it work so far. – Jonathan Sep 04 '17 at 13:04
  • I think Jonathan wants family-given/given-family in bold. See https://tex.stackexchange.com/a/178877/35864 – moewe Sep 04 '17 at 13:27
  • Just to clarify, so it would be lastname, firstname, first name lastname? But your example suggested APA citestyle, and APA uses lastname firstname, lastname firstname if I remember correctly. – M. Ridha Siregar Sep 04 '17 at 13:28
  • Great, it works perfectly now, thanks a lot! I wanted it to be in the family-given/given-family style. Sorry for the confusion, using APA citestyle was not necessary and it was not clear to me that it influences the order of given and family names. – Jonathan Sep 04 '17 at 14:03
  • My first example was not an APA either ;-) But I am glad it helps. Credit goes to @moewe because it is his codes (from the link he provided). – M. Ridha Siregar Sep 04 '17 at 14:06