# How to get (Hrsg.) after each editor with biblatex

I need to use a Citation style which is oriented at the german DIN1505 (see link for description https://de.wikipedia.org/wiki/DIN_1505-2#Aufbau_eines_Zitates Sorry only in German).

Here you an find an example for an kind of inbook formatting:

Schmidt, Kirsten ; Heiman, Bernhard ; Zhou, Ling: Qualität in Speditionen : nicht nur die Termintreue zählt. In: Ziems, Dietrich (Hrsg.) ; Neumann, Gaby (Hrsg.) ; Inderfurth, Karl (Hrsg.) ; Schenk, Michael (Hrsg.) ; Wäscher, Gerhard (Hrsg.) ; Otto-von-Guericke-Universität Magdeburg (Veranst.): Fachtagung Logistikqualität (10. Magdeburger Logistiktagung „Logistik aus technischer und ökonomischer Sicht“ Magdeburg 18. und 19. November 2004). Magdeburg : LOGiSCH, 2004, S. 51–66

As you can notice each editor has the short abbrevation (Hrsg.) (Hrsg. = German for Herausgeber/Editor) behind his name.

I understand the following commands define the editor string:

\DefineBibliographyStrings{german}{
}


and printing the editors with biblatex should be:

\renewbibmacro*{editor+others}{
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\setunit{\space}%
\clearname{editor}}
{}
}


How do I have to modify the macro, that "(Hrsg.)" is printed after each editor? I really enjoy biblatex, but sometimes the complexity is too much, so thank you for your comments on that specific formatting topic.

• Maybe this helps: github.com/domhardt/BibLaTeX-DIN1505 – Dr. Manuel Kuehner Oct 18 '16 at 23:47
• @ Dr. Manuel Kuehner, this was the basis for the style with some further modifications used at my institute. After researching the DIN1505 I learned, that it recommends to add (editor) after each editor, which I failed to implement. – Jäger Oct 19 '16 at 9:46

It is probably easiest to insert the editorstring in the name format directly. To this end we will have to copy all the relevant name format code and modify it in such a way that it appends the editor string.

\newrobustcmd*{\editorsep}{\addspace}
\newrobustcmd*{\editorwrap}{\mkbibparens}

\DeclareNameFormat{family-given-ed}{%
\ifgiveninits
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}%
\editorsep%
\editorwrap{%
\iffieldundef{editortype}
{\bibstring{editor}}
{\ifbibxstring{\thefield{editortype}}
{\bibstring{\thefield{editortype}}}
{\thefield{editortype}}}}%
\usebibmacro{name:andothers}}


Here family-given-ed is a verbose copy of biblatex.def's format family-given with only the last lines starting from \editorsep added.

We then use this format for editors

\DeclareNameAlias{editor}{family-given-ed}


Finally, we need to get rid of the old way to add the editor string in

\renewbibmacro*{editor}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\clearname{editor}}
{}}

\renewbibmacro*{editor+others}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\clearname{editor}}
{}}


Done!

The MWE

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@collection{Katmis2016,
editor       = {Katmis, Ferhat and Lauter, Valeria and Nogueira, Flavio S.},
title        = {Alternative Modernities},
date         = 2001,
publisher    = {Duke University Press},
location     = {Durham and London},
}
\end{filecontents*}

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

\newrobustcmd*{\editorwrap}{\mkbibparens}

\DeclareNameFormat{family-given-ed}{%
\ifgiveninits
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}%
\editorsep%
\editorwrap{%
\iffieldundef{editortype}
{\bibstring{editor}}
{\ifbibxstring{\thefield{editortype}}
{\bibstring{\thefield{editortype}}}
{\thefield{editortype}}}}%
\usebibmacro{name:andothers}}

\DeclareNameAlias{editor}{family-given-ed}

\renewbibmacro*{editor}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\clearname{editor}}
{}}

\renewbibmacro*{editor+others}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\clearname{editor}}
{}}

\begin{document}
Whatever \cite{Katmis2016,gaonkar}
\printbibliography
\end{document}


then gives

Gaonkar, Dilip Parameshwar (ed.). Alternative Modernities. Durham and London: Duke University Press. isbn: 0-822-32714-7.

Katmis, Ferhat (ed.), Lauter, Valeria (ed.), and Nogueira, Flavio S. (ed.). Alternative Modernities. Durham and London: Duke University Press.

• @ moewe, thanks for the MWE, to implement a new macro on family-given seem ike a good way, but when I use your approach it gives me ! Undefined control sequence. <argument> \namepartfamily... which I cannot understand, as \namepartfamily is successful used e.g. in the original family-given. biblatex version I use is v3.3 Right now the result gives me: "....In: (Hrsg.); (Hrsg.); (Hrsg.):...." which is fine except, that it doesn't use the editor names, obviously due to the error. – Jäger Oct 19 '16 at 9:44
• @Jäger The code above works with biblatex 3.6 (and therefore also with 3.5). You should do an update. If you mus use 3.3 (you really shouldn't it had some other bugs and backwards-compatibility issues) try adding \nameparts{#1} as the very first line in \DeclareNameFormat{family-given-ed}. – moewe Oct 19 '16 at 16:06
• @Jäger I have updated the answer to be a bit shorter. The solution for 3.3 should still be to add \nameparts{#1} to the name format. – moewe Oct 19 '16 at 16:13
• @ moewe, I already used your suggestions earlier this day, but it also gave me some errors. I then updated to biblatex v3.6 and it is running perfectly. Thank you for your help! – Jäger Oct 19 '16 at 22:49