使用 Biblatex-Chicago 将访问日期放在参考书目中的 URL 之后

使用 Biblatex-Chicago 将访问日期放在参考书目中的 URL 之后

我正在使用 Biblatex-Chicago 编制我的参考书目,但在我的印刷参考书目中,每个条目的访问日期都在 URL 之前列出,但我希望访问日期放在最后。

以下是 MWE:

 \documentclass[openany, 12pt]{book}

\usepackage{tabularx}
\usepackage{dcolumn}
\usepackage{graphicx}
\usepackage[margin=2.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{listings}
\usepackage{color}
\usepackage{subcaption}
\usepackage{hanging}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}

\onehalfspacing

\usepackage{fontspec} 
\setmainfont{Times New Roman}
\usepackage[short, backend=biber,
firstinits=true, sorting=nyt]{biblatex-chicago}
\bibliography{Dissertation.bib}

\newcolumntype{b}{X}
\newcolumntype{s}{<{\hsize=.5\hsize}X}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}

\lstset{frame=tb,
    language=R,
    aboveskip=3mm,
    belowskip=3mm,
    showstringspaces=false,
    columns=flexible,
    numbers=none,
    keywordstyle=\color{blue},
    numberstyle=\tiny\color{gray},
    commentstyle=\color{dkgreen},
    stringstyle=\color{mauve},
    breaklines=true,
    breakatwhitespace=true,
    tabsize=3
}

\begin{document}

Sample sentence.\footcite{Rae17}

\printbibliography[heading=none]

\end{document}

我使用的来源示例:

   @Electronic{Rae17,
  author       = {Alisdair Rae},
  year         = {2017},
  title        = {A Land Cover Atlas of the United Kingdom},
  organization = {University of Sheffield},
  url          = {https://figshare.com/articles/A_Land_Cover_Atlas_of_the_United_Kingdom_Document_/5266495},
  urldate = {2018-04-16}
}

当我执行时,参考书目中的条目如下所示:

[1]:https://i.stack.imgur.com/ox7b2.png

我希望访问日期位于 URL 之后。有人知道我该如何强制执行吗?

答案1

稍微改变 bib 驱动程序中字段的顺序:

 \documentclass[openany, 12pt]{book}

\usepackage{tabularx}
\usepackage{dcolumn}
\usepackage{graphicx}
\usepackage[margin=2.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{listings}
\usepackage{color}
\usepackage{subcaption}
\usepackage{hanging}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}

\onehalfspacing

%\usepackage{fontspec} 
%\setmainfont{Times New Roman}
\usepackage[short, backend=biber,
firstinits=true, sorting=nyt]{biblatex-chicago}
\bibliography{Dissertation.bib}

\newcolumntype{b}{X}
\newcolumntype{s}{<{\hsize=.5\hsize}X}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}

\lstset{frame=tb,
    language=R,
    aboveskip=3mm,
    belowskip=3mm,
    showstringspaces=false,
    columns=flexible,
    numbers=none,
    keywordstyle=\color{blue},
    numberstyle=\tiny\color{gray},
    commentstyle=\color{dkgreen},
    stringstyle=\color{mauve},
    breaklines=true,
    breakatwhitespace=true,
    tabsize=3
}

\makeatletter
\DeclareBibliographyDriver{online}{%
  \usebibmacro{bibindex}%
  \usebibmacro{author/editor}%
  \setunit{\addspace}%
  \printfield{nameaddon}%
  \newunit\newblock
  \usebibmacro{title+stitle}%
  \setunit{\addspace}%
  \usebibmacro{language+transtitle}%
  \newunit% 16th ed.
  \usebibmacro{byauthor}%
  \newunit\newblock
  \printlist{organization}% Rearranged for 16th ed.
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{date}%
  \newunit\newblock % <- moved
  \printfield{url}% <- moved
  \newunit\newblock
  \iffieldundef{urlyear}%
  {}%
  {\printurldate}% Date fix
  \newunit\newblock
  \iftoggle{cms@doionly}%
  {\iffieldundef{doi}%
    {}%
    {\printfield{doi}%
      \clearfield{url}}}%
  {\printfield{doi}}%
  \newunit\newblock
  \usebibmacro{eprint}%
  \newunit\newblock
  \printfield{addendum}%
  \newunit\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \iftoggle{cms@related}%
  {\usebibmacro{related:init}%
    \usebibmacro{related}%
    \newunit}%
  {}%
  \usebibmacro{originally+published+as}%
  \usebibmacro{finentry}}

\makeatother

\begin{document}

Sample sentence.\footcite{Rae17}

\printbibliography[heading=none]

\end{document}

答案2

chicago-notes.bbx我们可以借助包默认修补相关的参考书目驱动程序xpatch

 \documentclass[openany, 12pt]{book}

\usepackage{tabularx}
\usepackage{dcolumn}
\usepackage{graphicx}
\usepackage[margin=2.5cm]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{listings}
\usepackage{color}
\usepackage{subcaption}
\usepackage{hanging}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}

\onehalfspacing

\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage[short, backend=biber, giveninits, sorting=nyt]{biblatex-chicago}
\addbibresource{Dissertation.bib}

\newcolumntype{b}{X}
\newcolumntype{s}{<{\hsize=.5\hsize}X}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}

\lstset{frame=tb,
    language=R,
    aboveskip=3mm,
    belowskip=3mm,
    showstringspaces=false,
    columns=flexible,
    numbers=none,
    keywordstyle=\color{blue},
    numberstyle=\tiny\color{gray},
    commentstyle=\color{dkgreen},
    stringstyle=\color{mauve},
    breaklines=true,
    breakatwhitespace=true,
    tabsize=3
}

\usepackage{xpatch}
%
\xpatchbibdriver{online}{%
  \newunit\newblock
  \iffieldundef{urlyear}%
  {}%
  {\printurldate}% Date fix
 }{}{}{}

\xpatchbibdriver{online}{%
 \printfield{url}%
 }{%
 \printfield{url}%
  \newunit\newblock
  \iffieldundef{urlyear}%
  {}%
  {\printurldate}% Date fix
 }{}{}

\begin{document}

Sample sentence.\footcite{Rae17}

\printbibliography[heading=none]

\end{document} 

在此处输入图片描述

相关内容