1

This is a continuation of my previous question. I have the following line of code in my preamble

\pretocmd{\section}{\ifnum\value{section}=0 \else\clearpage\fi}{}{}

which puts each section on a new page except for the very first section of a chapter. My problem is that if I use something like

\printbibheading
\printbibliography[
 heading=bibintoc,
 keyword={books on things},
 title={Books on Things}
 ]       
\printbibliography[
 heading=bibintoc,
 notkeyword={books on things},
 title={Everything Else}
 ]

in the document body, then the bibliography title and the bibliography sections are also placed on 3 different pages, whereas I want them to stay together. My question is thus

Is there a way to modify the aforementioned code of line in such a way that it does not apply to the bibliography (or some such workaround)?

Thanks!

1

You can use the following in your preamble:

\newif\ifinbib
\pretocmd{\section}{\ifinbib\else\ifnum\value{section}=0 \else\clearpage\fi\fi}{}{}
\pretocmd{\printbibheading}{\inbibtrue}{}{}

It provides a new conditional \ifinbib (false by default) which is set to true as soon as you \printbibheading. After this, the conditional for \clearpage is never called.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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