4

I am writing my master thesis and started to work with biblatex. It is definitely easier than bibtex. I discovered that there is a special online type for websites and I wanted to use it, because I use quite some websites.

I want to list the websites in the following style:

Author, "Title", note, (date), URL, (URLdate)

Because of this I use the IEEE style and change it when there is a dot, but I can´t get a comma after the author and after the website.

I only get the following: What I get

Wich is

Author. "Title". note, (date), URL, (URLdate)

I tried to add the comma with the following, but this doesn´t work.

\DeclareFieldFormat[online]{tile}{\enquote{#1}\addcomma}
\DeclareFieldFormat[online]{author}{#1\addcomma}

Till now I used the type misc for websites, thats why i included it in my example code

\documentclass[12pt,a4paper,oneside,numbers=noenddot]{scrbook}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{lmodern} 
\usepackage[ngerman]{babel} 
\usepackage[babel,german=quotes]{csquotes}
\usepackage[hyphens]{url}
\usepackage[backend=biber,style=ieee,dashed=false]{biblatex}
\addbibresource{frage.bib}

\stdpunctuation \DeclareFieldFormat[online]{note}{#1\addcomma} \DeclareFieldFormat[misc]{date}{(#1)\addcomma} \renewcommand*{\finentrypunct}{}

\DeclareFieldFormat[online]{tile}{\enquote{#1}\addcomma}%does not work \DeclareFieldFormat[online]{author}{#1\addcomma}%does not work

\begin{filecontents}{frage.bib} @online{test, author = {{Internationales Elektrotechnisches Wörterbuch}}, title = {{Definition Verriegelung}}, year = {2017}, url = {https://www2.dke.de/de/Online-Service/DKE-IEV/Seiten/IEV-Woerterbuch.aspx#}, urldate = {2020-09-23}, note = {IEV-Nr. 395 -07-120}, } @misc{IEVVerriegelung, author = {{Internationales Elektrotechnisches Wörterbuch}}, title = {{Definition Verriegelung}}, date = 2017, url = {https://www2.dke.de/de/Online-Service/DKE-IEV/Seiten/IEV-Woerterbuch.aspx#}, urldate = {2020-09-23}, note = {IEV-Nr. 395 -07-120}, } \end{filecontents} \begin{document} \cite{test} \cite{IEVVerriegelung} \printbibliography[title=Literaturverzeichnis] \end{document}

Bernard
  • 271,350
nogoo
  • 43
  • 1
    Interesting question, first of there seems to be a typo: title not tile. Is it interesting that if one removes [online] then the changes does apply to misc but not online, why is online different – daleif May 03 '21 at 13:19
  • 2
    author is a name, so its format should be changed with \DeclareNameFormat[online]{author}... – Ulrike Fischer May 03 '21 at 13:52
  • @daleif thanks for hint about the typo, but this still doesn´t change anything and your right about about misc – nogoo May 03 '21 at 14:36
  • @UlrikeFischer thanks for that, when i change it to \DeclareNameFormat[online]{author}... than i get family=Internationales ElektrotechnischesWörterbuch, familyi=I.,

    which has probely something to do with Biblatex 3-3 name formatting

    – nogoo May 03 '21 at 14:46

2 Answers2

1

Instead of adjusting the field formats, it is easier and cleaner to change the driver: (Some styles use commands for the punctuation which can be adapted, but yours not).

\DeclareBibliographyDriver{online}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\addcomma\addspace}% <--- comma
  \usebibmacro{title}%
  \setunit{\addcomma\addspace}% <--- comma
  \printlist{language}%
  \setunit{\adddot\addspace}%
  \usebibmacro{byauthor}%
  \setunit{\adddot\addspace}%
  \usebibmacro{byeditor+others}%
  \setunit{\adddot\addspace}%
  \printfield{version}%
  \setunit{\adddot\addspace}%
  \printfield{note}%
  \setunit{\addcomma\addspace}% <-- comma ?
  \printlist{organization}%
  \setunit{\adddot\addspace}%
  \iftoggle{bbx:eprint}
    {\usebibmacro{eprint}}
    {}%
  \setunit{\adddot\addspace}%
  \printtext[parens]{\usebibmacro{date}}%
  \newunit\newblock
  \usebibmacro{url+urldate}%
  \setunit{\adddot\addspace}%
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
  \usebibmacro{finentry}}
Ulrike Fischer
  • 327,261
  • Thanks, i tried it and now I have a comma after the author.

    But I still have no comma after the title. The result is the following

    Internationales Elektrotechnisches Wörterbuch, „Definition Verriegelung.“ IEV-Nr. 395 -07-120, (2017), Adresse: https://www2.dke.de/de/Online-Service/DKEIEV/ Seiten/IEV-Woerterbuch.aspx# (besucht am 23. 09. 2020)

    And with \stdpunctuation can change that to Internationales Elektrotechnisches Wörterbuch, „Definition Verriegelung“. IEV..

    – nogoo May 03 '21 at 15:01
1

You can use the xpatch package to patch the bibliography driver for online entries. For use inside biblatex macros you should use \mkbibquote instead of the csquotes command \enquote.

\documentclass[12pt,a4paper,oneside,numbers=noenddot]{scrbook}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[ngerman]{babel} \usepackage[babel,german=quotes]{csquotes} \usepackage[hyphens]{url} \usepackage[backend=biber,style=ieee,dashed=false]{biblatex} \usepackage{xpatch} \addbibresource{frage.bib}

\stdpunctuation \DeclareFieldFormat[misc]{date}{(#1)\addcomma} \renewcommand*{\finentrypunct}{}

\usepackage{xpatch} \DeclareFieldFormat[online]{title}{\mkbibquote{#1}\addcomma} \xpatchbibdriver{online}{\adddot}{\addcomma}{}{} \xpatchbibdriver{online}{\adddot}{\addcomma}{}{} \begin{filecontents}{frage.bib} @online{test, author = {{Internationales Elektrotechnisches Wörterbuch}}, title = {{Definition Verriegelung}}, year = {2017}, url = {https://www2.dke.de/de/Online-Service/DKE-IEV/Seiten/IEV-Woerterbuch.aspx#}, urldate = {2020-09-23}, note = {IEV-Nr. 395 -07-120}, } @misc{IEVVerriegelung, author = {{Internationales Elektrotechnisches Wörterbuch}}, title = {{Definition Verriegelung}}, date = 2017, url = {https://www2.dke.de/de/Online-Service/DKE-IEV/Seiten/IEV-Woerterbuch.aspx#}, urldate = {2020-09-23}, note = {IEV-Nr. 395 -07-120}, } \end{filecontents} \begin{document} \cite{test} \cite{IEVVerriegelung} \printbibliography[title=Literaturverzeichnis] \end{document}

output of code

Alan Munn
  • 218,180
  • Thanks, that add the coma where I want it.
    I also want to change the dot after the note to comma.

    I can do that with \DeclareFieldFormat[online]{note}{#1\addcomma}, is there also a way with xpatch?

    – nogoo May 03 '21 at 15:28