Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm having trouble getting biblatex to break lines in a sensible way in the bibliography. Specifically, it seems that the line cannot be broken within the specification of chapter and/or page numbers.

Mostly, the breaks are fine just because there is no need to break at this point. So the example below is fairly specific and altering it slightly eradicates the problem. In my real bibliography, of course, I can't just change the book title or chapter number to make the lines easier for TeX to break!

MWE:

\documentclass[11pt,a4paper]{article}
\usepackage{geometry}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inbook{den-art-coll,
    crossref            =   {den-coll},
    title               =   {Personal Chips and Getting Oneself Good},
    pages               =   {345--564},
    chapter             =   89}
@suppbook{den-coll-intro,
    crossref            =   {den-coll},
    title               =   {Introduction},
    pages               =   {1--9}}
@book{den-coll,
  author                =   {Till, Jr., Dennis E.},
    booktitle           =   {Penguin Land and Further North: Human Influence},
    title               =   {Penguin Land and Further North: Human Influence},
    publisher           =   {Oxford University Press},
    year                =   2008,
    address             =   {Oxford and New York}}
\end{filecontents}
\usepackage[citestyle=authoryear-comp,bibstyle=authoryear,mergedate=basic,isbn=false,url=false,eprint=false,dashed=true,doi=false,sortcites=true,backend=biber,mincrossrefs=6]{biblatex}
\DefineBibliographyStrings{english}{%
  page                  =       {{}{}},
  pages                 =       {{}{}},
  }
\bibliography{\jobname}
\begin{document}

  \autocite{den-art-coll, den-coll-intro}

  \printbibliography

\end{document}

Poor line breaks in bibliography

What should I be doing differently to avoid this problem? Specifically, how do I persuade TeX to break the line following the chapter and before the page numbers when this is appropriate?

That is, I take it that the best break probably follows 'Chap. 89,' just before the first page in the page range. But TeX seems unwilling to break the line at this point. If I add a single letter to the book title, TeX breaks the line before 'Chap.' which suggests that it is treating 'Chap. 89, 345--' as a single unit which seems clearly undesirable.

share|improve this question

1 Answer 1

The formatting of chapter and page in inbook is controlled by chapter+pages bibmacro. This macro calls \bibpagespunct for the space between the chapter and the pages. By default this is a comma plus an inter word space. A possibility is to change it to encourage a \linebreak. The most drastic solution is to redefine \bibpagespunct to

\renewcommand{\bibpagespunct}{\addcomma\linebreak[1]\addspace}

A less drastic solution is to change the definition only for affected entries. For a single entry this can be done as follows:

\renewbibmacro{begentry}{%
  \iffieldequalstr{entrykey}{den-art-coll}
    {\renewcommand{\bibpagespunct}{\addcomma\linebreak\addspace}}
    {}%
}

For the example at hand we get:

enter image description here

share|improve this answer
    
(+1) This is definitely helpful but do you know why TeX will not allow a line break there anyway? That is, why isn't the space enough? Adding \linebreak[1] is certainly better than the status quo but it does, as you say, seem a little drastic. –  cfr Aug 12 at 14:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.