我如何将 URL 放在作者前面?

我如何将 URL 放在作者前面?

我对参考书目样式有非常具体的要求,但无法实现它们……我正在使用 bibTex 和 @online-entry,并且必须将 URL 放在条目的开头。因此它应该看起来像这样:
http//www.abc.com/xyz.html,Crane,G.,关于某事,访问于 2018 年 2 月 1 日。这是我的 .tex 文件:

\documentclass[12pt,a4paper, notitlepage]{article}  
\usepackage[style=authortitle, citestyle=authoryear, giveninits=true, 
uniquename=init, backend=biber]{biblatex}  
\DeclareNameAlias{sortname}{last-first}  
\bibliography{bib.bib}  
\renewbibmacro*{date}{\setunit{\addspace}\printdate}  
\renewcommand*{\newunitpunct}{\addcomma\space} 
\begin{document}  
\nocite{*}  
\printbibliography[type=online]  
\newpage  
\end{document}  

这是 bib.bib:

@online{test,
author = {Gerhard Crane},
title = {About something},
url = {http://abc.com/xyz.html},
urldate = {2018-02-01},
}

感谢您的帮助!

答案1

url我们稍微更改了字段格式urldate,并将 URL 移动到开头begentry

\documentclass[12pt,a4paper, notitlepage]{article}  
\usepackage[style=authortitle, citestyle=authoryear, giveninits=true, 
uniquename=init, backend=biber]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{test,
author = {Gerhard Crane},
title = {About something},
url = {http://abc.com/xyz.html},
urldate = {2018-02-01},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\DeclareNameAlias{sortname}{family-given}
\renewbibmacro*{date}{\setunit{\addspace}\printdate}
\renewcommand*{\newunitpunct}{\addcomma\space}

\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
\renewbibmacro{begentry}{\ifentrytype{online}{\usebibmacro{url}\clearfield{url}\newunit\newblock}{}}

\begin{document}  
\nocite{*}
\printbibliography[type=online]
\newpage
\end{document} 

在此处输入图片描述

相关内容