1

I'm trying to format two Biblatex entry types.

For the @incollection entry I want to get rid of the first comma (marked in yellow) and change the second comma to a period.

For the @online entry I can't seem to get rid of the date. Even if there is no date field in the entry, the brackets still show up but empty. I also want to change the comma after the title 'Polymer' to a period. Is there a way to suppress the 'Adresse:' (german for 'url:') string?

enter image description here

MWE:

\documentclass[11pt, oneside, a4paper, bibliography=totoc, parskip=half, 
   BCOR=12mm, captions=tableheading, openany, numbers=noenddot, headinclude, 
   liststotoc]{scrbook}
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{filecontents}
\begin{filecontents}{bibliography.bib}
@online{polymer2020,
    title = {Polymer},
    author = {{N. N.}},
    journaltitle = {Wikipedia},
    url = {https://de.wikipedia.org/wiki/Polymer},
    urldate = {2020-02-16}
}
@incollection{hans2020,
    title = {Ein {{Qualit\"atsicherungskonzept}}},
    booktitle = {Additive {{Fertigung}} von {{Bauteilen}}},
    author = {Hans, Peter and Werner, Meier},
    editor = {Michael, Hauser},
    date = {2020},
    publisher = {{Springer}},
    location = {{Berlin}}
}
\end{filecontents}

\usepackage[backend=biber, style=ieee, citestyle=numeric, sorting=nyt, 
   autocite=inline, isbn=false, dashed=false, url=false]{biblatex}
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{family-given}
\DeclareFieldFormat[book,inbook,incollection,inproceedings]{series}{#1}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
\DeclareFieldFormat*[online]{title}{\textit{#1}}
\renewcommand{\labelnamepunct}{\addcolon\space}
\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}
\renewcommand{\multinamedelim}{\addsemicolon\space}
\renewcommand{\finalnamedelim}{\addsemicolon\space}

\addbibresource{bibliography.bib}

\begin{document}
    \cite{polymer2020}
    \cite{hans2020}
    \printbibliography
\end{document}
1
  • Off-topic but still relevant: (a) The @online entry type doesn't process the journaltitle field type. I believe you should replace journaltitle = {Wikipedia} with organization = {Wikipedia}. (The field journaltitle should really only be used with entries of type @article.) (b) Unless you're obliged to stick to the pre-1995 German language spelling and hyphenation rules, you should probably replace \usepackage[german]{babel} with \usepackage[ngerman]{babel}.
    – Mico
    Commented Feb 16, 2020 at 20:40

1 Answer 1

2

For the first comma in the @incollection you need to redefine editortypedelim (see for example Remove comma after editor name in biblatex and biblatex: How to remove the comma before ed./eds.?).

The period is a bit tricker and in the example there are several ways to produce a period in that position, but the effects may vary if there are more fields in the entry. Here I decided to go via the bibmacro publisher+location+date.

The parentheses around the missing date can only be removed by patching the driver (cf. also Remove parentheses for empty year field biblatex ieee style, though the solution presented here is slightly more elegant).

Again the period in the @online entry can be produced in several ways. Since we are patching the driver already, I decided to patch it in such a way to insert the period directly before the URL. Again the result can vary if more fields are present.

\documentclass[11pt, oneside, a4paper, bibliography=totoc, parskip=half, BCOR=12mm, captions=tableheading, openany, numbers=noenddot, headinclude, liststotoc]{scrbook}
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

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


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

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

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

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

\DeclareDelimFormat[bib]{nametitlepunct}{\addcolon\space}

\DeclareFieldFormat*[online]{title}{\textit{#1}}

\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{online}
  {\printtext[parens]{\usebibmacro{date}}}
  {\usebibmacro{date}}
  {}{}

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

\DeclareFieldFormat{url}{\url{#1}}

\begin{filecontents}{\jobname.bib}
@online{polymer2020,
  title        = {Polymer},
  author       = {{N. N.}},
  journaltitle = {Wikipedia},
  url          = {https://de.wikipedia.org/wiki/Polymer},
  urldate      = {2020-02-16},
}
@incollection{hans2020,
  title     = {Ein Qualitätsicherungskonzept},
  booktitle = {Additive Fertigung von Bauteilen},
  author    = {Hans, Peter and Werner, Meier},
  editor    = {Michael, Hauser},
  date      = {2020},
  publisher = {Springer},
  location  = {Berlin},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
    \cite{polymer2020}
    \cite{hans2020}
    \printbibliography
\end{document}

Hans, P.; Werner, M., Ein Qualitätsicherungskonzept, in Additive Fertigung von Bauteilen, Michael, H. (Hrsg.). Berlin: Springer, 2020.//N. N. Polymer. https://de.wikipedia.org/wiki/Polymer (besucht am 16.02.2020).

You must log in to answer this question.

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