TransWikia.com

No pagebreak between citation entries in bibliography

TeX - LaTeX Asked on December 20, 2020

currently iam formatting my bibliography. If an entry cannot be placed on the end of a page without a pagebreak (the citation would be splitted on two pages) latex automatically induces a pagebreak. I thik, it looks a bit weird if the pages are not used to an equal extent.

Though some solutions are visible in google, I would like to ask if you know a very simple way to change it , i.e. use the full page and split entries to two pages.

Kind regards,

documentclass[12pt,twoside, openany]{book}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc} % Output font encoding for international characters
usepackage[greek,english]{babel}
usepackage{indentfirst} % Identation after chapter header
usepackage{graphicx}
graphicspath{{images/} }
usepackage[labelfont={bf},
        %belowskip=-10pt,
           %aboveskip=0pt
        singlelinecheck=false
       ]{caption}                           
usepackage{romannum}
usepackage[toc,page]{appendix}
usepackage{tabu}
usepackage{xltabular}
usepackage{booktabs,tabularx}
usepackage{pgfplots}
usepackage{boldline}
usepackage{epstopdf}
usepackage{multirow}
usepackage{amsmath}
usepackage{bm}
usepackage{enumitem}
usepackage{float}
usepackage{wrapfig}
usepackage{subfigure}
usepackage{xcolor}
usepackage{array}
newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}}
usepackage{comment}
usepackage{textgreek}
usepackage{parskip}
setlength{parskip}{baselineskip}

usepackage{url}
urlstyle{same}
usepackage[backend=biber,natbib=true,sorting=none,isbn=false,eprint=false,
doi=false,style=ieee,dashed=false,citestyle=numeric-comp]{biblatex}
AtEveryBibitem{clearfield{number}}
addbibresource{Reference.bib}
usepackage[intoc]{nomencl} % List of symbols
usepackage{makeidx}
makenomenclature
renewcommand{nomname}{List of Abbreviations}

usepackage{setspace}
usepackage{titlesec}
titlespacing*{section} % Spacing before/after (sub-) section titles
{0pt}{16pt plus 2pt minus 2pt}{18pt plus 2pt minus 2pt}
titlespacing*{subsection}
{0pt}{12pt plus 2pt minus 2pt}{10pt plus 2pt minus 2pt}
setcounter{secnumdepth}{4}
setcounter{tocdepth}{4}
titleformat{chapter}[hang]{Hugebfseries}{thechapter{. }}{0pt} 
{Hugebfseries} % Title without "Chapter" but Nr. in front

usepackage{amsmath}
usepackage{geometry}


usepackage{siunitx}
usepackage[acronym,toc]{glossaries}              % use glossaries-package


setlength{glsdescwidth}{15cm}

newglossary[slg]{symbolslist}{syi}{syg}{List of Symbols} % create add. symbolslist


glsaddkey{unit}{glsentrytext{glslabel}}{glsentryunit}{GLsentryunit}{glsunit}{Glsunit}{GLSunit}

makeglossaries                                   % activate glossaries-package


renewcommand*{glossaryheader}{%  Change the table header
%bfseries Sign & bfseries Description & bfseries Unit 
%hline
endhead}
renewcommand*{glossentry}[2]{%  Change the displayed items
glstarget{##1}{glossentryname{##1}} %
& glossentrydesc{##1}% Description
& glsunit{##1}  tabularnewline
 }
 }



geometry{
paper=a4paper, % Change to letterpaper for US letter
inner=2.5cm, % Inner margin
outer=2.5cm, % Outer margin
bindingoffset=.5cm, % Binding offset
top=1.5cm, % Top margin
bottom=1.5cm, % Bottom margin
headheight=15pt 
}

usepackage{fancyhdr}
pagestyle{fancy}
fancyhf{}
fancyhead[LE,RO]{}
fancyhead[RE,LO]{rightmark}
fancyfoot[RE,LO]{}
fancyfoot[CE,CO]{thepage}
renewcommand{headrulewidth}{0.4pt}
renewcommand{footrulewidth}{0.4pt}
%setlength{headsep}{0.4 cm} % Spacing between header and textblock below
setlength{footskip}{15pt}
usepackage[bottom]{footmisc}
fancyheadoffset{0pt}
fancyfootoffset{0pt}
%geometry{headheight=29.54742pt}
%setlength{headheight}{30pt}

%setlength{footnotesep}{0.5 cm}

One Answer

Normally, breaks are allowed in bibitems, but not between the first and second line, and they are discouraged before the final line. So a two-line bibitem will not break. You can insert the settings

clubpenalty=0 widowpenalty=0

to allow those breaks without penalty. If some package prevents all linebreaks, add interlinepenalty=0 to the two above.

If you use an explicit thebibliography environment, it is easy to insert the settings, but it is more difficult for bibliography or printbibliography. The cleanest way would be using the facilities of some package (for example, natbib has @bibsetup), but here is an ugly hackish way

letprevTheBibthebibliography
renewcommandthebibliography[1]{prevTheBib{#1}%
   clubpenalty=0 widowpenalty=0relax}

If the package is biblatex, it should be enough to change bibsetup (which is a macro, not a declaration hook as I thought). The (or a) normal bibsetup is

bibsetup ->interlinepenalty =5000relax widowpenalty =10000relax
  clubpenalty =10000relax raggedbottom frenchspacing biburlsetup 

which gives ALL your problems! Both preventing breaks and making the bottom ragged. So change it:

renewcommandbibsetup{clubpenalty=0 widowpenalty=0 interlinepenalty=0 
      flushbottom frenchspacing biburlsetup}

Finally, after comments, you want flush bottom but set a rigid bibitemsep, leaving no flexibility in the vertical list. On whatever page looks ragged-bottom, you should get a warning about

Underfull vbox (badness 10000) has occurred while output is active

meaning the page isn't intentionally ragged, but another line of text can't fit on it, and the text can't adjust position. Try a setting of

setlengthbibitemsep{0.75baselineskip plus 1pt minus 1pt}

instead. The default bibitemsep of 0pt is more problematic, but you could try

setlengthbibitemsep{0pt plus 0.1pt}

Achieving flush bottoms without any flexibility falls into the realm of "typesetting on a grid", and everything on the page has to be carefully crafted to occupy a multiple of baselineskip.

Correct answer by Donald Arseneau on December 20, 2020

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