1

Is there a way to prevent BibLaTeX from splitting page ranges over two lines automatically? I've noticed when editing my thesis's works cited that in a lot of cases BibLaTeX will split the page ranges over two lines. Now, I could prevent this by editing each page number entry to be within an \mbox{}, but I wanted to know if there was a better method that wouldn't involve editing each and every entry.

\documentclass{article}

\begin{filecontents}[overwrite]{\jobname.bib} @article{edited, author = {Angenendt, Arnold}, journaltitle = {Revue d'Histoire Eccl{'e}siastique}, date = 2002, volume = 97, pages = {\mbox{431--456}, \mbox{791--823} } } \end{filecontents}

\usepackage[style=chem-rsc]{biblatex} \addbibresource{biblatex-examples.bib} \addbibresource{\jobname.bib}

\begin{document}

Can we keep page ranges together without editing every entry?\autocite{angenendt,edited}

\printbibliography \end{document}

The first entry splits badly: The second one keeps both haves of the page range on one line

Canageek
  • 17,935
  • 1
    Naturally there is a way, but you should be aware that suppressing it will probably lead either to overfull boxes or to bad spacing. – Ulrike Fischer Oct 17 '20 at 08:41

1 Answers1

2

Yes, you can make the dash in page ranges (\bibrangedash) unbreakable. (In fact the dash is explicitly made breakable in the English localisation and you can roll that back.)

\documentclass{article}

\usepackage[style=chem-rsc]{biblatex}

\DefineBibliographyExtras{english}{% \protected\def\bibrangedash{% \textendash}}

\begin{filecontents}{\jobname.bib} @article{edited, author = {Angenendt, Arnold}, journaltitle = {Revue d'Histoire Ecclésiastique}, date = 2002, volume = 97, pages = {431-456, 791-823}, } \end{filecontents} \addbibresource{\jobname.bib} \addbibresource{biblatex-examples.bib}

\begin{document}

Can we keep page ranges together without editing every entry?\autocite{angenendt,edited}

\printbibliography \end{document}

A. Angenendt, Revue d’Histoire Ecclésiastique, 2002, 97, 431–456, 791–823.

But as Ulrike warned in the comments and the example shows, this can lead to overfull boxes. It is already hard enough to find good break points in the bibliography, but if you further remove possible break points, then at some point it is no longer possible to typeset the bibliography without bad spacing or overfull and underfull boxes.

Some more general comments about line breaking in the bibliography can be found in How to adjust the breaking in the bibliography?.

moewe
  • 175,683
  • Works perfectly. I've got article titles in my bibliography, which give lots of places to break, and the worst case scenario this would lead to 4 extra characters being moved to the next line (since I don't know of any journals that use five digit page numbers, and microtype lets the endash extend into the margin. More typical case would be 3, and I can certainly take 3 extra characters of whitespace in a line in the works cited over splitting the page number range! – Canageek Oct 19 '20 at 18:03