2

First question, so tell me all the things I do wrong!

So thanks to @moewe (Bold the last names authors/editors in a biblatex bibliography (but only the ones in front of the title)) my bibliography looks almost as I want it to. Two more things:

a) how do I put the "editor"-remark (in my German example "Hrsg.") in parentheses, without the comma after the name

b) how do I make the year bold?

So now it looks like: Lastname, Firstname, Hrsg. (YEAR): [...]

It should look like: Lastname, Firstname (Hrsg.) (YEAR): [...]

\documentclass[11pt, a4paper, ngerman, headsepline]{scrreprt}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage[ngerman]{babel}

%biblatex
\usepackage[
backend=biber,
style=authoryear-icomp,
ibidpage=true,
natbib,
ibidtracker=true,
idemtracker=true,
maxbibnames=9,
maxcitenames=2,
dashed=false
]
{biblatex}

\addbibresource{lit_test.bib}

%divide names by slash
\let\oldmultinamedelim\multinamedelim
\let\oldfinalnamedelim\finalnamedelim
\renewcommand*{\multinamedelim}{\addslash}
\renewcommand*{\finalnamedelim}{\addslash}

%last name bold
\DeclareNameAlias{sortname}{family-given-fb}
\DeclareNameFormat{family-given-fb}{%
    \renewcommand*{\mkbibnamefamily}[1]{\mkbibbold{##1}}%
    \ifgiveninits
    {\usebibmacro{name:family-given}
        {\namepartfamily}
        {\namepartgiveni}
        {\namepartprefix}
        {\namepartsuffix}}
    {\usebibmacro{name:family-given}
        {\namepartfamily}
        {\namepartgiven}
        {\namepartprefix}
        {\namepartsuffix}}%
    \usebibmacro{name:andothers}}

%colon insted of period after year
\renewcommand*{\labelnamepunct}{\addcolon\space}

\begin{document}

\cite{Hirsch}

\printbibliography

\end{document}
  • Your example would be even better if you used biblatex-exampes.bib as .bib file instead of referring to your file lit_test.bib which we don't have. For future questions you might want to keep in mind that we prefer to ask one question per question. – moewe Jun 26 '16 at 15:01
1

Add the following redefinitions of macros from authoryear.bbx to your preamble

The part for a) is a slightly modernised version of lockstep's answer to biblatex: How to remove the comma before ed./eds.?

\makeatletter
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareFieldFormat{parensbold}{\mkbibparens{\mkbibbold{#1}}}
\newbibmacro*{bbx:editor}[1]{%
  \ifboolexpr{
    test \ifuseeditor
    and
    not test {\ifnameundef{editor}}
  }
    {\usebibmacro{bbx:dashcheck}
       {\bibnamedash}
       {\printnames{editor}%
        \setunit{\addspace}%
        \usebibmacro{bbx:savehash}}%
     \usebibmacro{#1}%
     \clearname{editor}%
     \setunit{\printdelim{nameyeardelim}}}%
    {\global\undef\bbx@lasthash
     \usebibmacro{labeltitle}%
     \setunit*{\printdelim{nonameyeardelim}}}%
  \usebibmacro{date+extrayear}}

\renewbibmacro*{date+extrayear}{%
  \iffieldundef{\thefield{datelabelsource}year}
    {}
    {\printtext[parensbold]{%
       \iffieldsequal{year}{\thefield{datelabelsource}year}
         {\printdateextralabel}%
         {\printfield{labelyear}%
          \printfield{extrayear}}}}}%
\makeatother

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.