我使用 biblatex。我在参考书目条目之间遇到换行问题。我有短网址:
组织和 URL 之间的间距不是最佳的。我希望组织和 URL 之间没有换行符,并且 URL 中有连字符,就像长 URL 一样:
我用
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[USenglish]{babel}
\usepackage[bibstyle=authortitle,
citestyle=authoryear-ibid,
natbib=true,
urldate=long,
firstinits=true,
uniquename=false,
backend=bibtex]{biblatex}
%==== online sources format =====
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\printtext{Last accessed}\addcolon\space#1}
\urlstyle{rm}
\DeclareBibliographyDriver{online}{%
\printnames{author}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}\addcolon%
\newunit\newblock
\printfield{url}%
\newunit
\printurldate%
\finentry}
%===================================
\addbibresource{my.bib}
\begin{document}
\citet[UDE][]{ARUS}
\citep{AESOPComplexity}
\raggedright
\printbibliography
\end{document}
和 my.bib
@ELECTRONIC{AESOPComplexity,
author = {AESOP},
note = {Association of European Schools of Planning},
organization = {Thematic group Planning and Complexity},
date={2015},
urldate = {2015-01-22},
url = {http://www.aesop-planning.eu/blogs/en_GB/planning-and-complexity}
}
@ELECTRONIC{ARUS,
author = {ARUS},
note = {Advanced Research in Urban Systems},
organization = {Structured PhD program at the University of Duisburg Essen},
institution = {UNIVERSIT\"AT DUISBURG-ESSEN},
address = {Germany},
date={2015},
urldate = {2015-01-22},
url = {https://www.uni-due.de/urbane-systeme/advanced-research-in-urban-systems_en.shtml}
}
我不删除 \raggedright 可以解决这个问题吗?
谢谢你!
答案1
这源于你在\DeclareFieldFormat{url}
和中输出 URL 的方式\DeclareBibliographyDriver{online}
。实际上,这意味着 URL 前的最后一个空格是普通空格,biblatex
并且很多不太愿意在所述空间处中断,而不是中断 URL。
我们可以使 URL 前的最后一个空格不中断,从而biblatex
强制在某处中断 URL(尽管 URL 中断是一个非常微妙的问题,我认为最好避免)。
\DeclareBibliographyDriver{online}{%
\printnames{author}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}%<--- no \addcolon anymore
\printunit{\addcolon\addnbspace}% <---- this is new
\printfield{url}%
\newunit
\printurldate%
\finentry}
平均能量损失
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[USenglish]{babel}
\usepackage{filecontents}
\usepackage[bibstyle=authortitle,
citestyle=authoryear-ibid,
natbib=true,
urldate=long,
firstinits=true,
uniquename=false]{biblatex}
%==== online sources format =====
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\printtext{Last accessed}\addcolon\space#1}
\urlstyle{rm}
\DeclareBibliographyDriver{online}{%
\printnames{author}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\printunit{\addcolon\addnbspace}%
\printfield{url}%
\newunit
\printurldate%
\finentry}
%===================================
%===================================
\begin{filecontents*}{\jobname.bib}
@ELECTRONIC{AESOPComplexity,
author = {AESOP},
note = {Association of European Schools of Planning},
organization = {Thematic group Planning and Complexity},
date={2015},
urldate = {2015-01-22},
url = {http://www.aesop-planning.eu/blogs/en_GB/planning-and-complexity}
}
@ELECTRONIC{ARUS,
author = {ARUS},
note = {Advanced Research in Urban Systems},
organization = {Structured PhD program at the University of Duisburg Essen},
institution = {UNIVERSIT\"AT DUISBURG-ESSEN},
address = {Germany},
date={2015},
urldate = {2015-01-22},
url = {https://www.uni-due.de/urbane-systeme/advanced-research-in-urban-systems_en.shtml}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\citet[UDE][]{ARUS}
\citep{AESOPComplexity}
\raggedright
\printbibliography
\end{document}