TransWikia.com

Placing a line break within a biblatex entry

TeX - LaTeX Asked on April 14, 2021

I am using biblatex with Biber as the backend. I am struggling with overfull hboxes in my bibliography.

In the following image, "Dispersion Forces" sticks out past the margin. I would like to place a line break at the position marked by the red vertical line, even though doing so will likely cause an underfull hbox. How can I do this?

bibentry

Here is some code, though it is not compilable; I don’t have a MWE because I’m not sure how to reproduce the "(196)" without including 196 biblatex entries.

% .tex file:

usepackage[semibold,tt=false]{libertine}
usepackage{libertinust1math}
usepackage[
  expansion = false ,
  tracking = smallcaps ,
  letterspace = 40 ,
  final
]{microtype}
usepackage[style=chem-acs,articletitle=true,chaptertitle=true,refsection=chapter,maxbibnames=99,maxcitenames=99,doi=true,defernumbers=true]{biblatex}

documentclass[oneside,11pt,draft]{book}

begin{document}

end{document}

% .bib file:

@ARTICLE{Trulsson2010,
  author = {Trulsson, Martin and Algotsson, Jenny and Forsman, Jan and Woodward, Clifford E.},
  title = {Differential Capacitance of Room Temperature Ionic Liquids: The Role of Dispersion Forces},
  journal = {J. Phys. Chem. Lett.},
  year = {2010},
  volume = {1},
  pages = {1191--1195}
}

One Answer

The simplest way to manually insert a line break in a field content in the bibliography is to write into the .bib entry. Of course this is not a very sustainable solution, since .bib files are supposed to be re-usable and this is a very situation-dependent fix. In general I would advise against putting those kind of ad hoc fixes into the .bib file because they could come back and bite you in different situations.

Even though I wouldn't recommend it, the following certainly works

documentclass[oneside,11pt,draft]{book}
usepackage[semibold,tt=false]{libertine}
usepackage{libertinust1math}
usepackage[
  expansion=false,
  tracking=smallcaps,
  letterspace= 40,
  final
]{microtype}
usepackage[style=chem-acs,
  maxbibnames=99, maxcitenames=99,
  articletitle=true, chaptertitle=true,
  doi=true,
  defernumbers=true,
  refsection=chapter,
]{biblatex}

begin{filecontents}{jobname.bib}
@ARTICLE{Trulsson2010,
  author  = {Trulsson, Martin and Algotsson, Jenny
             and Forsman, Jan and Woodward, Clifford E.},
  title   = {DifferentialCapacitance of Room Temperature
             Ionic Liquids: The Role of Dispersion Forces},
  journal = {J. Phys. Chem. Lett.},
  year    = {2010},
  volume  = {1},
  pages   = {1191--1195}
}
end{filecontents}
addbibresource{jobname.bib}

% to fake the labelnumber
DeclareFieldFormat{labelnumberwidth}{mkbibparens{196}}

begin{document}
cite{Trulsson2010}
printbibliography
end{document}

Forced line break: Diferential//Capacitance of Room Temperature Ionic Liquids: The Role of Dispersion//Forces.

Instead I would try to get rid of the overful box by using one of the methods discussed in How to adjust the breaking in the bibliography?.

In this example a bit of emergencystretch helps (.1em is enough here).

documentclass[oneside,11pt,draft]{book}
usepackage[semibold,tt=false]{libertine}
usepackage{libertinust1math}
usepackage[
  expansion=false,
  tracking=smallcaps,
  letterspace= 40,
  final
]{microtype}
usepackage[style=chem-acs,
  maxbibnames=99, maxcitenames=99,
  articletitle=true, chaptertitle=true,
  doi=true,
  defernumbers=true,
  refsection=chapter,
]{biblatex}

apptobibfont{setlength{emergencystretch}{.1em}}

begin{filecontents}{jobname.bib}
@ARTICLE{Trulsson2010,
  author  = {Trulsson, Martin and Algotsson, Jenny
             and Forsman, Jan and Woodward, Clifford E.},
  title   = {Differential Capacitance of Room Temperature
             Ionic Liquids: The Role of Dispersion Forces},
  journal = {J. Phys. Chem. Lett.},
  year    = {2010},
  volume  = {1},
  pages   = {1191--1195}
}
end{filecontents}
addbibresource{jobname.bib}

% to fake the labelnumber
DeclareFieldFormat{labelnumberwidth}{mkbibparens{196}}

begin{document}
cite{Trulsson2010}
printbibliography
end{document}

Diferential Ca-//pacitance of Room Temperature Ionic Liquids: The Role of Dispersion//Forces.

But if you have many tricky references, setting the bibliography ragged right might be a better option.

Answered by moewe on April 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP