2

I need a pretty specific human-science citation style, that's why things got a bit difficult. Most of the times it works, but now I've got a problem: sometimes a book as only one or more editors, which get then printed instead of the authors (when you leave the author field empty). Now something strange happend. When I have four authors, it will print Fischer, Wolfgang et al.: Title and so on. When I don't fill in the author and want to add four or more editors, i get this: Fischer, Wolfgang et al., (Hgg.): Title and so on. It should be: Fischer, Wolfgang et al. (Hgg.): Title ... . Strangely, when I type in author and editor (inbook or incollection usually, but also book class) I get: Author: Title. In: Editor et al. (Hgg.): Booktitle. - as it should be (no extra comma after et al.). How do I get rid of this specific extra comma?

MWE (sorry it's very long because of the complicated citation-style):

\begin{filecontents}{MWE.bib}
@book{Fischer:EWSG,
    editor = {Wolfram Fischer and Jan A. van Houtte and Hermann Kellenbenz and Ilja Mieck and Friedrich Vittinghoff},
    title = {Europäische Wirtschafts- und Sozialgeschichte von der Mitte des 19. Jahrhunderts bis zum ersten Weltkrieg},
    subtitle = {Handbuch der Europäischen Wirtschafts- und Sozialgeschichte},
    date = {1985},
    location = {Stuttgart},
}
@book{Pfister:Strom,
    author = {Christian Pfister and Muster, Hans and Muster, Beat and Muster, Friedrich},
    title = {Im Strom der Modernisierung},
    subtitle = {Bevölkerung, Wirtschaft und Umwelt 1700-1914},
    booktitle = {Geschichte des Kantons Bern seit 1798, Bd. 4},
    editor = {Junker, Beat and Pfister, Christian and Muster, Hans and Muster, Beat},
    date = {1995},
    location = {Bern},
}
\end{filecontents}

\documentclass[11pt, a4paper, tablecaptionabove]{scrartcl} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
%=============BIBLIOGRAPHIE, ZITIERWEISE=================== %
\usepackage[babel,german=guillemets]{csquotes}
\usepackage[%
style=alphabetic,
style=verbose-ibid,
labeldate,
dashed=false, %bei mehreren Werken desselben Autors kein Strich
backend=bibtex8,
idemtracker=false,
ibidtracker=constrict,
citepages=omit,
]{biblatex}

\usepackage{xpatch}

%Hg. bzw Hgg. in Klammern hinter Herausgeber, statt davor und vor Titel
\renewbibmacro*{byeditor+others}{%
    \ifnameundef{editor}
    {}
    {\printnames[byeditor]{editor}%
        \setunit{\addspace}%
        \usebibmacro{editor+othersstrg}%
        \clearname{editor}%
        \newunit}%
    \usebibmacro{byeditorx}%
    \usebibmacro{bytranslator+others}
    \setunit{\addcolon\space}
    \usebibmacro{booktitle}}
\xpatchbibmacro{byeditor+othersstrg}{\printtext}{\printtext[parens]}{}{}

\DefineBibliographyStrings{german}{%
    andothers = {et\ al\adddot}, %et al. statt u.a.
    editor = {\mkbibparens{Hg\adddot}}, %Hg. statt Hrsg.
    editors = {\mkbibparens{Hgg\adddot}}, %Hgg. plural
    byeditor = {\mkbibparens {Hg\adddot}}, 
}
\DeclareFieldFormat{postnote}{#1} %unterdrückt Präfix S.
\DeclareFieldFormat{multipostnote}{#1} %unterdrückt Präfix S.
\DeclareNameAlias{default}{last-first} %Autoren immer Nachname, Vorname sortieren
\renewbibmacro*{cite:short}{%
    \printnames{labelname}%
    \setunit*{\nameyeardelim}%
    \iffieldundef{labelyear}
    {}
    {\printtext[\addcolon]{\printtext[bibhyperlink]{%
                \printfield{labelyear}%
                \printfield{extrayear}}}}}

%Edition Feld superscript, wenn erlaubt
\DeclareFieldFormat{edition}{%
    \ifinteger{#1}
    {\textsuperscript{#1}}

    {\isdot\setunit{}}}

%\DeclareNameFormat{default}{%
%\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}%
%\usebibmacro{name:andothers}}
\renewcommand{\multinamedelim}{\addsemicolon\space} %Semikolon zum trennen der Autoren
\renewcommand{\finalnamedelim}{\addsemicolon\space}
\renewcommand{\labelnamepunct}{\addcolon\space} %Zwischen Autor und Titel Doppelpunkt, kein Punkt
\renewcommand{\postnotedelim}{\addcolon\space} %Zwischen Jahrzahl und Seitenzahl Doppelpunkt, kein Komma
\renewcommand{\nametitledelim}{\addspace}
\renewbibmacro*{publisher+location+date}{% %Zwischen Ort und Jahr kein Komma
    \printlist{location}%
    {\setunit*{\addspace}}
    \printfield{edition}%
    \usebibmacro{date}%
    \newunit}

%überflüssiges Editionsfeld entfernen
\newcommand{\replaceedition}[1]
{%
    \xpatchbibdriver{#1}
    {\printfield{edition}%
        \newunit}
    {}%
    {}
    {\typeout{failed to patch driver #1}}
}
\replaceedition{book}
\replaceedition{collection}
\replaceedition{inbook}
\replaceedition{incollection}
\replaceedition{manual}

\renewbibmacro*{maintitle+booktitle}{%
    \iffieldundef{maintitle}
    {}
    {\usebibmacro{maintitle}%
        \newunit\newblock
        \iffieldundef{volume}
        {}
        {\printfield{volume}%
            \printfield{part}%
            \setunit{\addcolon\space}}}%
    %\usebibmacro{booktitle}%
    \newunit}

\xpatchbibdriver{inbook}{%
    \usebibmacro{maintitle+booktitle}%
    \newunit\newblock
    \usebibmacro{byeditor+others}%
}%
{%
    \usebibmacro{byeditor+others}%
    \setunit{\addcolon\space}\newblock
    \usebibmacro{maintitle+booktitle}%
}%
{}{}%

\xpatchbibdriver{inbook}{%
    \newunit\newblock
    \usebibmacro{chapter+pages}%
}%
{%
    \addcolon\space
    \usebibmacro{chapter+pages}%
}%
{}{}

\xpatchbibdriver{inbook}{%
    \newunit
    \iffieldundef{maintitle}
}%
{%
    \setunit{\addcomma\space}
    \iffieldundef{maintitle}
}%
{}{}

\xpatchbibdriver{incollection}{%
    \usebibmacro{maintitle+booktitle}%
    \newunit\newblock
    \usebibmacro{byeditor+others}%
}%
{%
    \usebibmacro{byeditor+others}%
    \setunit{\addcolon\space}\newblock
    \usebibmacro{maintitle+booktitle}%
}%
{}{}%

\xpatchbibdriver{incollection}{%
    \newunit\newblock
    \usebibmacro{chapter+pages}%
}%
{%
    \addcolon\space
    \usebibmacro{chapter+pages}%
}%
{}{}

\xpatchbibdriver{incollection}{%
    \newunit
    \iffieldundef{maintitle}
}%
{%
    \setunit{\addcomma\space}
    \iffieldundef{maintitle}
}%
{}{}

\xpatchbibdriver{inproceedings}{%
    \usebibmacro{maintitle+booktitle}%
    \newunit\newblock
    \usebibmacro{byeditor+others}%
}%
{%
    \usebibmacro{byeditor+others}%
    \setunit{\addcolon\space}\newblock
    \usebibmacro{maintitle+booktitle}%
}%
{}{}%

\xpatchbibdriver{inproceedings}{%
    \newunit\newblock
    \usebibmacro{chapter+pages}%
}%
{%
    \addcolon\space
    \usebibmacro{chapter+pages}%
}%
{}{}

\xpatchbibdriver{inproceedings}{%
    \newunit
    \iffieldundef{maintitle}
}%
{%
    \setunit{\addcomma\space}
    \iffieldundef{maintitle}
}%
{}{}

%Titel nicht in Anführungszeichen; S. vor Seitenangabe entfernen
\DeclareFieldFormat[inproceedings]{title}{#1}
\DeclareFieldFormat[inproceedings]{pages}{#1}
\DeclareFieldFormat[inbook]{title}{#1}
\DeclareFieldFormat[inbook]{pages}{#1}
\DeclareFieldFormat[incollection]{title}{#1} 
\DeclareFieldFormat[incollection]{pages}{#1}
\DeclareFieldFormat[article]{title}{#1}
\DeclareFieldFormat[article]{pages}{#1}


%\renewcommand{\nametitledelim}{\space}

% Titel nicht schräg
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat{citetitle}{#1}
\DeclareFieldFormat{booktitle}{#1}
\DeclareFieldFormat{maintitle}{#1}

% Journal Titel nicht schräg
\DeclareFieldFormat{journaltitle}{#1}

\bibliography{MWE} %name des .bib-Files

%=============ENDE BIBLIOGRAPHIE, ZITIERWEISE=================== %

\begin{document}
\autocite{Pfister:Strom}
\autocite{Fischer:EWSG}

\printbibliography
\end{document}

This gets me the following: On the top you can see the et. al., in front of the (Hgg.) - the comma should not be there. On the bottom you can see the et al. before the (Hgg.) in the bottom line, without comma. On the top you can see the et. al., in front of the (Hgg.) - the comma should not be there. On the bottom you can see the et al. before the (Hgg.) in the bottom line, without comma.

Julian
  • 157
  • Short update: the comma also appears in front of the Hgg. (when used as author) if the author list is not shortened (when maxbibnames=8 for example), or when only 1 editor is used (comma before (Hg.)). – Julian Feb 02 '15 at 10:38
  • 1
  • 1
    I notice that you have style=alphabetic, style=verbose-ibid, in your MWE, that is slightly confusing, you can only load one style: either alphabetic or verbose-ibid. – moewe Feb 04 '15 at 15:45
  • Oh, I didn't even see that and I never got a warning... thanks for pointing out! – Julian Feb 04 '15 at 17:17
  • Hey moewe,

    I had to revome the \printtext[parens], because it printed 2 times the parens but now it works (although I don't really know why), so thanks alot! If you want to, you can answer this question :)

    – Julian Feb 10 '15 at 14:12
  • 1
    I'd much rather close your question as a duplicate of the one I linked to. Also to prevent the double-parens, I'd prefer deleting \mkbibparens{...} in \DefineBibliographyStrings{german} instead of getting rid of \printtext[parens]. – moewe Feb 10 '15 at 15:30

1 Answers1

0

I had a similar problem and could solve it by adding a "\nopunct" :

\DefineBibliographyStrings{german}{%
andothers = {et\ al\adddot\nopunct}, %et al. statt u.a.

In biblatex-documentation they define:

\nopunct Adds an internal marker which will cause the next punctuation command to print nothing.

Hope this helps.

Markus
  • 1
  • 1
    Note though that hard-coding \nopunct into the "et al."-string might lead to unwanted effects if the editor string does not follow, but a punctuation mark that should not be suppressed (e.g. a colon after the author names). – moewe Feb 04 '15 at 15:40
  • I'll test it on friday, as soon as I'm home. Thanks for the answer :) – Julian Feb 04 '15 at 17:18
  • As moewe said, if I add the \nopunct then it'll remove the colon after the normal author, if there is an et al. used. Thanks for the idea, but this unfortunately doesn't solve my problem (which probalby isn't solveable) :( – Julian Feb 07 '15 at 21:42