使用 IEEE 风格和在线类型的 Biblatex 标题后不能加逗号吗?

使用 IEEE 风格和在线类型的 Biblatex 标题后不能加逗号吗?

我正在写我的硕士论文,开始使用 biblatex。它绝对比 bibtex 容易。我发现有一种专门用于网站的在线类型,我想使用它,因为我使用了很多网站。

我想按以下样式列出网站:

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

因此,我使用 IEEE 样式并在有点时进行更改,但在作者和网站后面无法得到逗号。

我只得到以下内容: 我得到了什么

哪个是

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

我尝试使用以下内容添加逗号,但是没有效果。

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

到目前为止,我使用 misc 类型来表示网站,这就是为什么我将其包含在我的示例代码中

\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}

答案1

您可以使用该xpatch软件包修补在线条目的参考书目驱动程序。若要在biblatex宏中使用,您应该使用\mkbibquote而不是csquotes命令\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}

代码输出

答案2

与调整字段格式相比,更改驱动程序更加容易和干净:(某些样式使用可以适应的标点符号命令,但您的样式不能)。

\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}}

相关内容