2

The following question-answers show a method of avoiding page-breaks in between references:
How can I prevent page break between lines of a paragraph or bibliography entry?
https://tex.stackexchange.com/a/51259/8303

The answers which suggest inserting \interlinepenalty=10000 are simple and work really well. However, each time bibtex compiles the .bbl file, I have to manually edit it for inserting the interline penalty command. Then I have to run my .bat file all over again after commenting out the bibtex.exe command.

Since this is a bit cumbersome, is there a way I could configure bibtex.exe to do it for me?

  • Continuing with my approach related to most of the things that don't work out the straight way (usually because of me being ignorant of the straight way), I am currently writing a Python script to do this repetitive task for me. – Shashank Sawant Sep 19 '14 at 16:52
4

If you add

@preamble{"\interlinepenalty=10000 "}

in the .bib file, the instruction will appear before \begin{thebibliography}. If you want it to hold only in the thebibliography environment, just patch \thebibliography.

\usepackage{etoolbox}

\AtBeginDocument{%
  \apptocmd\thebibliography{\interlinepenalty=10000 }{}{}%
}

should do.

  • I didn't understand the difference between the two solutions you have provided. If I add @preamble{"\in...} in the .bib file, the instruction will appear before \begin{thebi...}. Why is this different from your second solution, in that why will it affect environments other than the thebibliography environment? – Shashank Sawant Sep 19 '14 at 17:06
  • 2
    @ShashankSawant The \@preamble solution makes the setting to \interlinepenalty hold until \end{document}. If the bibliography is the last thing in the document, it's obviously the simplest strategy. With the “patch” method, the change is limited to the environment and ends with \end{thebibliography}. – egreg Sep 19 '14 at 17:09
1

The field @preamble is there for things like these.

@preamble{"\interlinepenalty=10000"}

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.