如何将参考书目中的日期移到标题之前?
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@online{gates,
author = {Bill Gates},
title = {Save the world!},
url = {https://www.gatesfoundation.org/de/},
urldate = {2016-07-04},
organization = {Bill and Melinda Gates Foundation},
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=authortitle]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{urldate}{visted at #1}
\DeclareListFormat{organization}{%
\usebibmacro{list:delim}{#1}%
\mkbibemph{#1}\isdot
\usebibmacro{list:andothers}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\printdelim{nametitledelim}}\newblock
\printlist{organization}%
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\footcite{gates} \cite{gates}
\printbibliography
\end{document}
答案1
由于您已经更改了 bibdriver(由于Biblatex 移动组织)我建议你将通话时间\usebibmacro{date}
稍微移一点。
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@online{gates,
author = {Bill Gates},
title = {Save the world!},
date = {2016-05-04},
url = {https://www.gatesfoundation.org/de/},
urldate = {2016-07-04},
organization = {{Bill and Melinda Gates Foundation}},
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=authortitle]{biblatex}
\addbibresource{\jobname.bib}
\DefineBibliographyStrings{english}{
urlseen = {visited at}
}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
\DeclareListWrapperFormat{organization}{\mkbibemph{#1}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\newunit\newblock
\printlist{organization}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\footcite{gates} \cite{gates}
\printbibliography
\end{document}
nametitledelim
由于现在驱动程序中没有明确的位置,因此它被通常的所取代\newunit\newblock
。
请注意我强烈建议使用方法 圭多建议Biblatex 更改上次访问:最好始终使用 bibstring,硬编码文本应该是最后的手段。
我也应用了对较新版本的首选解决biblatex
方案使用 biblatex 显示机构而不是\DeclareListFormat{organization}
像 3.12 之前的版本那样更尴尬。如果命令\DeclareListWrapperFormat
无法识别,请参阅该答案以寻求解决方法。
我想指出的是,organization
在@online
驱动程序中通常将放置 是有意义的,因为organization
可以被看作与 非常类似publisher
,并且institution
这些列表通常与位置和日期一起打印在条目的末尾(至少如果日期没有被移动到作者年份样式的条目的前面)。
organization = {{Bill and Melinda Gates Foundation}},
最后请注意 中的双花括号organization
是一个列表字段,如果只使用一对括号,Biber 会将列表解析为包含两个组织“比尔”和“梅琳达·盖茨基金会”。双花括号转义了 的特殊含义,and
并确保只解析一个组织,即“比尔和梅琳达·盖茨基金会”。您可以在示例中看到不使用双花括号的不良副作用:“and”是直立的,而 的其余部分organization
是斜体。