2

I use Biblatex creating the bibliography for my recent paper at university. My professor wants us to set single spaces for the bibliography (for the rest of the document onehalfspacing). Unfortunately, when I use

\begin{singlespace}
\printbibliography
\end{singlespace}

the title of the bibliography takes singlespace as well. Consequently it is not at the same height as the other chaptertitles which have onehalfspacing.

How can I conserve the bibliography title’s onehalfspacing and have singlespacing for the bibliography entries?

Edit: Additionally to the spacing, the bibliography entries need to have font size small. How can I customize this without changing the bibliography title’s size?

  • 3
    Welcome, I have answered your question and I hope it is helpful to you, in the future when you post questions could you include more information about your settings (document class, packages etc) and preferably include a minimal working example (MWE) please? Makes it easier to help as in my answer I have had to make assumptions (book class, bibliography title, biber backend etc) which might not be accurate to your case. MWE format is here: https://tex.meta.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-working-example-mwe-what-is-that –  Aug 20 '21 at 00:16
  • 1
    Alright, thank you a lot for your answer and the advice concerning my question! I’ll respect it next time. – Gustave Flaubert Aug 20 '21 at 13:06

2 Answers2

3

We can include both the font size and the line spacing change in \bibfont. Unfortunately setspace's \singlespacing also issues a \vskip, which causes problems in \bibfont when it is used to measure label width, so we define our own copy without that \vspace.

\documentclass[british]{book}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[onehalfspacing]{setspace}

\usepackage[backend=biber, style=numeric]{biblatex} \usepackage{lipsum}

\makeatletter \newcommand{\noskipsinglespacing}{% \setstretch {\setspace@singlespace}% normally 1 } \makeatother

\renewcommand*{\bibfont}{\small\noskipsinglespacing}

\addbibresource{biblatex-examples.bib}

\begin{document} \chapter*{Lorem ipsum dolor sit amet consectur} \lipsum[2]

\chapter{Lorem} Lorem \autocite{sigfridsson,worman,nussbaum,geer} \lipsum[1]

\printbibliography[title={Lorem ipsum dolor sit amet consectur}] \end{document}

Bibliography with onehalfspaced heading and singlespaced, small content.

moewe
  • 175,683
1

For your edit, the preferred way to change the bibliography font size to \small is by using \renewcommand*{\bibfont}{\small} (courtesy of moewe). There is probably a better way to change the linespacing of individual entries within biblatex but the following code does as you require (assuming you are using the title option of \printbibliography):

\documentclass[oneside]{book}

\usepackage[backend=biber,natbib=true,style=numeric]{biblatex} \usepackage{blindtext} \usepackage{setspace}

\begin{filecontents}{\jobname.bib} @article{one, author = {Chi, Yu-Chou and Lee, Shou-Lun and Lai, Ching-Long and Lee, Yung-Pin and Lee, Shiao-Pieng and Chiang, Chien-Ping and Yin, Shih-Jiun}, journal = {Chemico-Biological Interactions}, pages = {134--141}, title = {{Ethanol oxidation and the inhibition by drugs in human liver, stomach and small intestine: Quantitative assessment with numerical organ modeling of alcohol dehydrogenase isozymes}}, volume = {258}, year = {2016} } @article{two, author = {Adolf-Bryfogle, Jared and Teets, Frank D and Bahl, Christopher D}, journal = {Current Opinion in Structural Biology}, pages = {170--177}, title = {{Toward complete rational control over protein structure and function through computational design}}, volume = {66}, year = {2021} } \end{filecontents}

\addbibresource{\jobname.bib}

\renewcommand*{\bibfont}{\small} % Answer to edit

\onehalfspacing

\begin{document}

\chapter{One} \blindtext \cite{one, two}

% Answer to main question \begingroup \singlespacing \printbibliography[title={\onehalfspacing Really long title so that it spans two lines so the line stretching can be observed}] \endgroup

\end{document}

This example produces this in the main text:

enter image description here

And produces this in the bibliography:

enter image description here

I have used \begin{filecontents}{\jobname.bib}...\end{filecontents} to include references for examples and you do not require it, the package blindtext has been used to create filler text in chapter 1 and you can change \addbibresource to your reference file. Using \begingroup and \endgroup keeps everything which occurs inside local. Hope this helps.