Biblatex-DW 的分隔符问题:从引文中删除逗号

Biblatex-DW 的分隔符问题:从引文中删除逗号

我目前正在研究如何个性化 Biblatex-DW 样式,以满足我的博士论文需求。到目前为止,我自己已经解决了一些问题,但目前的问题让我很头疼,因为我不太熟悉代码。

所有类型文档的最终引用样式应为:

[作者姓氏小写]([年份]),[无前缀的页码]。

到目前为止我得到:

[作者姓氏小写],([年份])[无前缀的页码]。

我填写了大部分字段,以确保引用中没有打印不属于那里的字段。

以下是我进行 MWE 的尝试:

    \documentclass[11pt, a4paper]{book}
    \usepackage{acronym}
    \usepackage[ngerman]{babel}
    \usepackage[parfill]{parskip}
    \usepackage{csquotes}

\begin{filecontents*}{test.bib} 
@misc{bar_zitiertest_2004,
  title = {Zitiertest Dokument 2 Autoren},
  shorttitle = {Krzttl},
  author = {Bär, Gold and Rahmen, Bilder},
  date = {2004-05-19},
  publisher = {{Verlag}},
  url = {www.url.aub},
  urldate = {2020-01-13},
  abstract = {Zusammenfassung},
  langid = {deutsch},
  note = {Extra}
}

@mvbook{baum_zitiertest_2006,
  title = {Zitiertest Buch 3 Autoren},
  shorttitle = {Krzttl},
  author = {Baum, Tannen and Zange, Kneif and Kopf, Schafs},
  date = {2006-05-19},
  edition = {7},
  volume = {1},
  publisher = {{Verlag}},
  location = {{Ort}},
  url = {www.url.de},
  urldate = {2020-01-13},
  abstract = {Zusammenfassung},
  isbn = {0815},
  langid = {deutsch},
  note = {Extra},
  number = {55},
  pagetotal = {999},
  series = {Reihe},
  volumes = {2}
}

@incollection{eis_zitiertest_2004,
  title = {Zitiertest Buchteil 5 Autoren},
  shorttitle = {Krzttl},
  booktitle = {Warum Schneemänner keine Heißgetränke zu sich nehmen sollten ...},
  author = {Eis, Schoko and Tasse, Kaffee and Salat, Kartoffel and Duck, Donald and Mann, Schnee},
  date = {2004-05-19},
  edition = {1},
  volume = {5},
  pages = {999},
  publisher = {{Verlag}},
  location = {{Ort}},
  url = {www.url.aub},
  urldate = {2020-01-13},
  abstract = {Zusammenfassung},
  isbn = {0815},
  langid = {deutsch},
  note = {Extra},
  number = {45},
  series = {Reihe},
  volumes = {9}
}
\end{filecontents*}

\usepackage[
    style=footnote-dw,
    annotation=true,
    edstringincitations=true,
    idembib=false,
    library=true,   
    namefont=smallcaps,
    shorthandibid=false,
    xref=false,
    abbreviate=true,
    backref=false,
    bibwarn=true,
    ibidtracker=false,      
    idemtracker=false,
    isbn=false,
    maxnames=3,
    natbib=true,
    sorting=nyt,
    sortlocale=auto,
    url=false,
    backend=biber
]{biblatex}

    \addbibresource{test.bib}

\usepackage[utf8]{inputenc}
\usepackage[LGR, T1]{fontenc}   
\usepackage{geometry}   
    \geometry{margin=3cm}                   

\renewcommand*{\bibmultinamedelim}{\addsemicolon\space}
\renewcommand*{\citefinalnamedelim}{\addsemicolon\space}
\renewcommand*{\citemultinamedelim}{\addsemicolon\space}

%Last names only in citations:
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{default}{labelname}

%Getting rid of fields/lists/names in citations:
\AtEveryCitekey{\clearfield{abstract}}%
\AtEveryCitekey{\clearfield{afterword}}%
\AtEveryCitekey{\clearfield{annotation}}%
\AtEveryCitekey{\clearfield{annotator}}%
\AtEveryCitekey{\clearfield{annote}}%
\AtEveryCitekey{\clearfield{authortype}}%
\AtEveryCitekey{\clearfield{bookauthor}}%
\AtEveryCitekey{\clearfield{bookpagination}}%
\AtEveryCitekey{\clearfield{booksubtitle}}%
\AtEveryCitekey{\clearfield{booktitle}}%
\AtEveryCitekey{\clearfield{chapter}}%
\AtEveryCitekey{\clearfield{commentator}}%
\AtEveryCitekey{\clearfield{crossref}}%
\AtEveryCitekey{\clearfield{day}}%
\AtEveryCitekey{\clearfield{edition}}%
\AtEveryCitekey{\clearfield{eventtitle}}%
\AtEveryCitekey{\clearfield{howpublished}}%
\AtEveryCitekey{\clearfield{issue}}%
\AtEveryCitekey{\clearfield{journal}}%
\AtEveryCitekey{\clearfield{journaltitle}}%
\AtEveryCitekey{\clearfield{key}}%
\AtEveryCitekey{\clearfield{month}}%
\AtEveryCitekey{\clearfield{note}}%
\AtEveryCitekey{\clearfield{number}}%
\AtEveryCitekey{\clearfield{organization}}%
\AtEveryCitekey{\clearfield{pages}}%
\AtEveryCitekey{\clearfield{publisher}}%
\AtEveryCitekey{\clearfield{school}}%
\AtEveryCitekey{\clearfield{series}}%
\AtEveryCitekey{\clearfield{shorttitle}}%
\AtEveryCitekey{\clearfield{title}}%
\AtEveryCitekey{\clearfield{type}}%
\AtEveryCitekey{\clearfield{url}}%
\AtEveryCitekey{\clearfield{urldate}}%
\AtEveryCitekey{\clearfield{urlyear}}%
\AtEveryCitekey{\clearfield{volume}}%
\AtEveryCitekey{\clearfield{volumes}}%
\AtEveryCitekey{\clearlist{address}}%
\AtEveryCitekey{\clearlist{institution}}%
\AtEveryCitekey{\clearlist{location}}%
\AtEveryCitekey{\clearname{editor}}%
\AtEveryCitekey{\clearname{journal}}%

%Getting rid of >in:<:
\DefineBibliographyStrings{ngerman}{in = {}}

%Putting the date into parens for the citation & undoing it for the bibliography again:
\DeclareFieldFormat{date}{\mkbibparens{#1}}
\AtBeginBibliography{\DeclareFieldFormat{date}{#1}}

%Getting rid of the page prefix:
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\renewcommand*{\bibpagespunct}{\addcolon\addspace}
\renewcommand{\postnotedelim}{%
\iffieldpages{postnote}{\addspace}{\addspace}}

\begin{document}

Citation nr. 1\cite[19]{bar_zitiertest_2004}\newline
Citation nr. 2\cite[13-56]{baum_zitiertest_2006}\newline
Citation nr. 3\cite[2-3]{eis_zitiertest_2004}

   \printbibliography 
   \end{document}

很高兴纠正错误并尽快回答问题 - Flo

答案1

footnote-dw是“详细”系列的一种样式,用于在脚注引文中打印完整的参考书目条目。您需要的更多是作者年份样式。尝试将详细样式变为作者年份样式似乎非常复杂,因为这相当于删除几乎所有的引文信息。这可能相当麻烦。

最好只采用像这样的样式authoryear作为您的引用样式。通常,biblatex允许您选择不同的bibstylecitestyle值。不幸的是,由于引用和参考书目样式之间存在很强的依赖性,因此无法轻松地将包的样式biblatex-dw与包外的任意其他样式相结合。因此像这样的解决方案bibstyle=footnote-dw, citestyle=authoryear,不起作用。

如果你想坚持一种biblatex-dw风格,我认为最简单的解决方案就是以此authortitle-dw为基础,修改其引用命令,使其成为作者-年份风格,而不是作者-标题风格。事实证明,这实际上是可行的,不需要太多工作。

我们只需要加载style=authortitle-dw,然后我们需要提供信息。和的重新定义应该是labeldateparts=true,不言自明的。我们还进行了修改 以使用正确的分隔符。biblatexlabeldatecite:titlecite:title:forcecite:edstringincitations

\documentclass[11pt, a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage{csquotes}

\usepackage[
    backend=biber,
    style=authortitle-dw,
    sorting=nyt,
    labeldateparts=true,
    maxnames=3,
%
    annotation=true,
    edstringincitations=true,
    idembib=false,
    library=true,
    namefont=smallcaps,
    shorthandibid=false,
    xref=false,
    abbreviate=true,
    backref=false,
    bibwarn=true,
    ibidtracker=false,
    idemtracker=false,
    isbn=false,
    natbib=true,
    url=false,
]{biblatex}


\DeclareDelimFormat[footcite,smartcite]{nameyeardelim}{\addspace}
\renewbibmacro*{cite:edstringincitations}{%
  \ifbool{cbx:edstringincitations}
    {\usebibmacro{cite:editorstrg/translatorstrg}}
    {}%
  \setunit{\printdelim{nameyeardelim}}}

\DeclareFieldFormat{labeldate}{%
  \ifbool{cbx:parens}
    {#1}
    {\mkbibparens{#1}}}

\renewbibmacro*{cite:title}{%
  \ifboolexpr{
    test {\ifentrytype{review}}
    and
    not test {\iffieldundef{xref}}
  }
    {\printtext[review]{\bbx@review{\thefield{xref}}}}
    {\printtext[bibhyperref]{\printlabeldateextra}}}

\renewbibmacro*{cite:title:force}{%
  \printtext[bibhyperref]{\printlabeldateextra}}

\renewcommand*{\bibmultinamedelim}{\addsemicolon\space}
\renewcommand*{\citemultinamedelim}{\bibmultinamedelim}
\renewcommand*{\citefinalnamedelim}{\citemultinamedelim}


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

\renewbibmacro*{in:}{}

\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareFieldFormat{multipostnote}{\mknormrange{#1}}
\renewcommand{\postnotedelim}{\addcomma\space}

\renewcommand*{\bibpagespunct}{\addcolon\addspace}

\begin{filecontents*}{\jobname.bib}
@misc{bar_zitiertest_2004,
  title      = {Zitiertest Dokument 2 Autoren},
  shorttitle = {Krzttl},
  author     = {Bär, Gold and Rahmen, Bilder},
  date       = {2004-05-19},
  publisher  = {Verlag},
  url        = {www.url.aub},
  urldate    = {2020-01-13},
  abstract   = {Zusammenfassung},
  langid     = {ngerman},
  note       = {Extra}
}
@mvbook{baum_zitiertest_2006,
  title      = {Zitiertest Buch 3 Autoren},
  shorttitle = {Krzttl},
  author     = {Baum, Tannen and Zange, Kneif and Kopf, Schafs},
  date       = {2006-05-19},
  edition    = {7},
  volume     = {1},
  publisher  = {Verlag},
  location   = {Ort},
  url        = {www.url.de},
  urldate    = {2020-01-13},
  abstract   = {Zusammenfassung},
  isbn       = {0815},
  langid     = {ngerman},
  note       = {Extra},
  number     = {55},
  pagetotal  = {999},
  series     = {Reihe},
  volumes    = {2}
}
@incollection{eis_zitiertest_2004,
  title      = {Zitiertest Buchteil 5 Autoren},
  shorttitle = {Krzttl},
  booktitle  = {Warum Schneemänner keine Heißgetränke zu sich nehmen sollten \dots},
  author     = {Eis, Schoko and Tasse, Kaffee and Salat, Kartoffel
                and Duck, Donald and Mann, Schnee},
  date       = {2004-05-19},
  edition    = {1},
  volume     = {5},
  pages      = {999},
  publisher  = {Verlag},
  location   = {Ort},
  url        = {www.url.aub},
  urldate    = {2020-01-13},
  abstract   = {Zusammenfassung},
  isbn       = {0815},
  langid     = {ngerman},
  note       = {Extra},
  number     = {45},
  series     = {Reihe},
  volumes    = {9}
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
Citation nr. 1\autocite[19]{bar_zitiertest_2004}

Citation nr. 2\autocite[13-56]{baum_zitiertest_2006}

Citation nr. 3\autocite[2-3]{eis_zitiertest_2004}

\printbibliography
\end{document}

酒吧; Rahmen (2004),19.//Baum;贊格; Kopf (2006), 13–56。//Eis ua (2004), 2–3。

相关内容