1

I am trying to get my bibliography to my needs, and there is one comma which I don't know how to remove.

In entry [2] ('inbook') it is correct, but in entry [1] ('book' without author, just editor) there shouldn't be the comma.

enter image description here

It is really difficult for me to understand all the biblatex commands, so it would be great if someone could help me with this issue.

My minimal working example:

\documentclass{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}

\usepackage[backend=biber,style=authoryear]{biblatex}
\usepackage{csquotes}
\usepackage{filecontents}

\begin{filecontents*}{bib.bib}
@book{awv_stmk,
    editor = "{Hans Wurst}",
    title = "{Das Leben}"
}

@inbook{book2,
    author = "Hans Wurst",
    booktitle = "Das Leben",
    editor = "Biene Maja",
    title = "Artikel"
}
\end{filecontents*}

\addbibresource{bib.bib}


% Put editor string in parentheses
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}

% Like editor+others but without comma before editor string and dash checks
\newbibmacro*{ineditor+others}{%
  \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}} }
    {\printnames{editor}%
     \setunit{\addspace}%
     \usebibmacro{editor+othersstrg}%
     \clearname{editor}}
    {}}

% Print editors before "in" title
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}%
  \usebibmacro{ineditor+others}%
  \newunit
  \clearname{editor}}

\begin{document}

\nocite{*}
\printbibliography

\end{document}
3

Edit: For authoryear style, you modify the bbx:editor macro to put in a space instead of a comma and space. Try adding this:

\usepackage{xpatch}
\xpatchbibmacro{bbx:editor}
  {\addcomma\space}{\addspace}{}{}

You can also do an equivalent change for bbx:translator.

  • Thanks for the reply - it is working for me on sharelatex, but not in my full project on my pc. Therefore I will need more time next week finding out why, and then I can come back to here to give more feedback. – pato Mar 17 '17 at 15:24
  • Okay it was my fault, because in my actual project I am using [style=authoryear], which somehow ignores the code from your answer. I am sorry that I didn't know i should have included this information in my Question! Do you also know, how I can reach my goal in this case? – pato Mar 19 '17 at 19:16
  • For authoryear style you need to edit the bbx:editor macro instead of editor+others. I updated my answer. – David Purton Mar 19 '17 at 22:52
  • Thank you very much it works :-) I also added the style=authoryear line to my question. – pato Mar 20 '17 at 12:41
  • In current versions of biblatex this does not work any more since there is a dedicated editortypedelim now. \DeclareDelimFormat{editortypedelim}{\addspace} should do the same thing. See tex.stackexchange.com/a/419595/35864 – moewe Mar 11 '18 at 8:54

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.