0

I've done several augmentations to my bibliography style. But I can't figure out one things.

I want to have a colon after the last author of the @article instead of a comma. It seems to work for all other entry types. Also there is no colon after the @online author.

This is what it currently looks like: enter image description here

MWE:

\documentclass[11pt, a4paper]{scrbook}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[left=27.5mm,right=16mm,top=30mm,bottom=30mm]{geometry}

\usepackage{filecontents}
\begin{filecontents}{BA.bib}
@online{polymer2020,
  title = {Polymer},
  author = {{N. N.}},
  journaltitle = {Wikipedia},
  url = {https://de.wikipedia.org/wiki/Polymer},
  urldate = {2020-02-16},
  langid = {german}
}

@thesis{kaddar2010,
  title = {Die generative Fertigung mittels Laser-Sintern: Scanstrategien, Einfl\"usse verschiedener Prozessparameter auf die mechanischen und optischen Eigenschaften beim LS von Thermoplasten und deren  Nachbearbeitungsm\"oglichkeiten},
  author = {Kaddar, Wesam},
  date = {2010},
  institution = {{Universit\"at Duisburg-Essen}},
  location = {{Duisburg}},
  langid = {german},
  type = {Dissertation}
}

@incollection{hans2020,
  title = {Ein {{Qualit\"atsicherungskonzept}}},
  booktitle = {Additive {{Fertigung}} von {{Bauteilen}}},
  author = {Hans, Peter and Werner, Meier},
  editor = {Furman, Bernd and Eder, Max},
  date = {2020},
  publisher = {{Springer}},
  location = {{Berlin}}
}

@article{drummer2010,
  title = {Untersuchung der Materialalterung bei pulverbasierten Schichtbauverfahren},
  author = {Drummer, Dietmar and K\"uhnlein, Florian and Rietzel, Dom and H\"udler, Gerrit},
  date = {2010},
  journaltitle = {RTejournal - Forum f\"ur Rapid Technologie},
  volume = {7},
  langid = {german},
  number = {1}
}
\end{filecontents}

\usepackage[backend=biber, style=ieee, citestyle=numeric, sorting=nyt, autocite=inline, isbn=false, dashed=false, url=false]{biblatex}
\addbibresource{BA.bib}
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}

\DeclareFieldFormat[book,inbook,incollection,inproceedings]{series}{#1}

\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldFormat*[online]{title}{\textit{#1}}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat[article]{title}{\textit{#1}\addperiod}
\DeclareFieldFormat[thesis]{title}{\textit{#1}\addperiod}

\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}
\renewcommand{\multinamedelim}{\addsemicolon\space}
\renewcommand{\finalnamedelim}{\addsemicolon\space}
\renewcommand*{\labelnamepunct}{\addcolon\addspace}

\renewbibmacro*{publisher+location+date}{%
\printunit{\addperiod\space}%
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
\DeclareFieldFormat[online]{date}{\mkbibparens{#1}}
\usepackage{xpatch}
\xpatchbibdriver{online}
{\printtext[parens]{\usebibmacro{date}}}
{\usebibmacro{date}}
{}{}

\xpatchbibdriver{online}
{\newunit\newblock
\usebibmacro{url+urldate}}
{\setunit{\addperiod\space}\newblock
\usebibmacro{url+urldate}}
{}{}


\begin{document}

\autocite{polymer2020} \autocite{hans2020} \autocite{kaddar2010} \autocite{drummer2010}

\printbibliography

\end{document}
1
  • You are applying a lot of modifications to the IEEE style, so I'm wondering if it might be easier to start with a different style like numeric or maybe even ext-numeric: ieee was specifically written to duplicate IEEE style and the main focus was not customisability. The standard styles on the other hand and also the styles of my biblatex-ext bundle were written with customisability in mind.
    – moewe
    Feb 18, 2020 at 17:01

1 Answer 1

1

biblatex-ieee is a bit inconsistent in its driver code here. Most drivers in ieee.bbx have

\setunit{\labelnamepunct}\newblock

between author and title. (\labelnamepunct was deprecated recently, one would now say \setunit{\printdelim{nametitledelim}}\newblock instead.) But the @article driver only has \newunit and the @online driver has \setunit{\adddot\addspace}% instead. I understand that the @online driver needs to be different because the IEEE wants periods for online documents, but commas for all other types. But I don't know why @article is different.

You will have to patch the drivers for @article and @online to get a colon here.

\xpatchbibdriver{article}
  {\usebibmacro{author/translator+others}%
   \newunit}
  {\usebibmacro{author/translator+others}%
   \printunit{\labelnamepunct}\newblock}
  {}{}

The patch for @online can be combined with the patch that is already present

\xpatchbibdriver{online}
  {\printtext[parens]{\usebibmacro{date}}%
   \setunit{\adddot\addspace}}
  {\usebibmacro{date}%
   \printunit{\labelnamepunct}\newblock}
  {}{}

Note that usually I would not use \labelnamepunct. The modern method is \printdelim{nametitledelim}, but since ieee.bbx is still using \labelnamepunct the deprecated command makes it easier here.

In full

\documentclass[11pt, a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}


\usepackage[backend=biber, bibstyle=ieee, citestyle=numeric, sorting=nyt,
  autocite=inline,
   dashed=false, isbn=false,url=false]{biblatex}

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

\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}

\DeclareDelimFormat{multinamedelim}{\addsemicolon\space}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}

\renewcommand*{\labelnamepunct}{\addcolon\addspace}


\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}

\DeclareFieldFormat*[online]{title}{\textit{#1}}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{journaltitle}{#1}
\DeclareFieldFormat[article]{title}{\textit{#1}\addperiod}
\DeclareFieldFormat[thesis]{title}{\textit{#1}\addperiod}

\DeclareFieldFormat[book,inbook,incollection,inproceedings]{series}{#1}


\renewbibmacro*{publisher+location+date}{%
  \printunit{\addperiod\space}%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcolon\space}}%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}

\DeclareFieldFormat[online]{date}{\mkbibparens{#1}}

\usepackage{xpatch}
\xpatchbibdriver{article}
  {\usebibmacro{author/translator+others}%
   \newunit}
  {\usebibmacro{author/translator+others}%
   \printunit{\labelnamepunct}\newblock}
  {}{}

\xpatchbibdriver{online}
  {\printtext[parens]{\usebibmacro{date}}%
   \setunit{\adddot\addspace}}
  {\usebibmacro{date}%
   \printunit{\labelnamepunct}\newblock}
  {}{}

\xpatchbibdriver{online}
  {\newunit\newblock
   \usebibmacro{url+urldate}}
  {\setunit{\addperiod\space}\newblock
   \usebibmacro{url+urldate}}
  {}{}


\begin{filecontents}{\jobname.bib}
@online{polymer2020,
  title        = {Polymer},
  author       = {{N.\,N.}},
  journaltitle = {Wikipedia},
  url          = {https://de.wikipedia.org/wiki/Polymer},
  urldate      = {2020-02-16},
  langid       = {ngerman}
}
@thesis{kaddar2010,
  title       = {Die generative Fertigung mittels Laser-Sintern:
                 Scanstrategien, Einflüsse verschiedener Prozessparameter
                 auf die mechanischen und optischen Eigenschaften beim
                 LS von Thermoplasten und deren Nachbearbeitungsmöglichkeiten},
  author      = {Kaddar, Wesam},
  date        = {2010},
  institution = {Universität Duisburg-Essen},
  location    = {Duisburg},
  langid      = {ngerman},
  type        = {Dissertation},
}
@incollection{hans2020,
  title     = {Ein Qualitätsicherungskonzept},
  booktitle = {Additive Fertigung von Bauteilen},
  author    = {Hans, Peter and Werner, Meier},
  editor    = {Furman, Bernd and Eder, Max},
  date      = {2020},
  publisher = {Springer},
  location  = {Berlin},
}
@article{drummer2010,
  title        = {Untersuchung der Materialalterung bei pulverbasierten
                  Schichtbauverfahren},
  author       = {Drummer, Dietmar and Kühnlein, Florian and Rietzel, Dom and Hüdler, Gerrit},
  date         = {2010},
  journaltitle = {RTejournal - Forum für Rapid Technologie},
  volume       = {7},
  langid       = {ngerman},
  number       = {1},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\autocite{polymer2020,hans2020,kaddar2010,drummer2010}

\printbibliography
\end{document}

Bibliography with colons.


I'd like to repeat my observation from the comments.

You are applying a lot of modifications to the IEEE style, so I'm wondering if it might be easier to start with a different style like numeric or maybe even ext-numeric: biblatex-ieee was specifically written to duplicate IEEE style and customisability was a secondary focus (at best). The standard styles on the other hand and also the styles of my biblatex-ext bundle were written with customisability in mind.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .