当使用 biblatex 的长 URL 且没有太多正斜杠时,URL 会溢出页面边缘。
例如:
参考文献.bib
@online{ons,
author = "Office for National Statistics",
title = "Overview of the UK population: July 2017",
url = {https://www.ons.gov.uk/peoplepopulationandcommunity/populationandmigration/populationestimates/articles/overviewoftheukpopulation/july2017},
year = "2017"
}
主文本
\documentclass[12pt,a4paper]{article}
\usepackage[style=ieee,citestyle=ieee,dashed=false]{biblatex}
\addbibresource{references.bib}
\begin{document}
Lots of text
...
\cite{ons}
\newpage
\printbibliography
\end{document}
如何修复此问题?
答案1
三条建议:
加载
xurl
包。它允许在 URL 字符串的任意位置换行。将
author
字段放在一对额外的花括号中,这样 biber/bibtex 就不会将名称误解为由名字部分“Office”、von 部分“for”和姓氏部分“National Statistics”组成。请注意,在您发布的屏幕截图中,“名字部分”被截断为其首字母“O”。不好!将单词括
UK
在一对花括号中,以防止其变成小写。再次查看您发布的屏幕截图:“UK”一词被渲染为“uk”。不好!
\RequirePackage{filecontents}
\begin{filecontents}{references.bib}
@online{ons,
author = "{Office for National Statistics}",
title = "Overview of the {UK} population: July 2017",
url = {https://www.ons.gov.uk/peoplepopulationandcommunity/populationandmigration/populationestimates/articles/overviewoftheukpopulation/july2017},
year = "2017"
}
\end{filecontents}
\documentclass[12pt,a4paper]{article}
\usepackage[style=ieee,citestyle=ieee,dashed=false]{biblatex}
\addbibresource{references.bib}
\usepackage{xurl}
\begin{document}
\cite{ons}
\newpage
\printbibliography
\end{document}