1

Possible duplicate How can I prevent page break between lines of a paragraph or bibliography entry?

I have some bibliography entries and one of them gets split on 2 pages. exaclty as posted in the following thread, but unfortunatly there was no answer. same problem but unanswered

maybe someone can help me out by explaining how to force the whole respective entry on the next page or extend the page by 1 or 2 lines. Or other solutions.

tried using package xurl- no results tried

\bibliographystyle{unsrtdin}
\enlargethispage{1\baselineskip}
\bibliography{meinebib}

didn't do what I hoped for

Cheers

7
  • Hi @CRoNiC and Welcome to TeX-SE. Are you using the same MWE as the other thread? Have you tried the package xurl? I think it might solve. I remember using it for line breaks but don't remember exactly how is the behavior or how other packages or bibliographystyles might interfere.
    – FHZ
    Feb 17, 2020 at 12:53
  • If the offending entry is on the first page of the bibliography, you could try inserting this command before the bibliography: \enlargethispage{1\baselineskip}. (This should be done only on the final run.) Feb 17, 2020 at 19:30
  • @FHZ i tried using xurl but nothing seems to change.
    – CRoNiC
    Feb 17, 2020 at 22:02
  • @barbarabeeton tried your suggestion aswell, but nothing happened too. see edit
    – CRoNiC
    Feb 17, 2020 at 22:03
  • 1
    If there are exactly two lines of the bib entry left on the second page, trying to enlarge the first page by 1\baselineskip might be foiled by a prohibition against leaving widow lines, so instead using \enlargethispage{2\baselineskip} might have a better chance. Or decrease the length of the first page by 1 line (or 2, if you have a situation where the bib entry is exactly 4 lines long). If you could show the troublesome entry as typeset (but as a unit, not split), we wouldn't be so dependent on our crystal ball. Feb 18, 2020 at 1:09

1 Answer 1

2

Before answering, I would like to point out a very important thing. When asking questions, please inform us a MWE. It helps a lot to know your problem and avoids misinterpretations.

That said, I will assume your problem is not url splitting into 2 pages, but actually any bibliography text splitting into 2 pages.

For this question, there was an answer: How can I prevent page break between lines of a paragraph or bibliography entry?

The simplest method is to insert \interlinepenalty=10000 in your preamble. Edit Note: It will change the behavior of the whole text. Explanations below.

From the link: "You can modify the variable that tells TeX how bad an idea it is to break up lines of a paragraph". Check the link for a full explanation.

OBS: When you asked about the link, I really thought the issue came from large links going beyond the page or similarly. Sorry for that.

Please, test this option in your text.

Figures to illustrate follow.

Without \interlinepenalty=10000.

enter image description here

With \interlinepenalty=10000.

enter image description here

Edit: Following barbaras comment.

With \interlinepenalty=10000 at preamble you will break paragraphs you probably don't want.

enter image description here

With \interlinepenalty=10000 just before bibliography only References will break as desired. Other paragraphs will break normally.

enter image description here

A MWE (with my external .bib files, sorry for that) follows.

\documentclass[11pt]{article}

\usepackage[a4paper,top=2cm,bottom=2cm,left=2cm,right=2cm,marginparwidth=1.75cm]{geometry}
\usepackage{hyperref}
\usepackage{lipsum}
\bibliographystyle{unsrtdin}

% ============ Here, all paragraphs will not break
%\interlinepenalty=10000

\begin{document}

\cite{Meza_Zucatelli_Interface_2016}, \cite{Zucatelli_Meza_Fenili_LagranTexPack}.

\lipsum[1-14]. % 13 14

A.

B.

%C.
%
%D.

% ============ Here, only paragraphs in bibliography will not break
\interlinepenalty=10000

% Use your external .bib file.
\bibliography{C:/Users/FHZ/Dropbox/Artigos_Publicados_pdf_bib/Artigo_Meza_Zucatelli_IJCSSE_Bibtex,C:/Users/FHZ/Dropbox/Artigos_Publicados_pdf_bib/Artigo_Zucatelli_Meza_Fenili_LagranTexPack_IJCTE_Bibtex}

\end{document}
2
  • 2
    \interlinepenalty=10000 would indeed take care of this; good for you for finding the linked question. But in this case, placing that command in the preamble may be too severe. Depending on the nature of the document, particularly if it contains long paragraphs, it could be counterproductive to prohibit all paragraphs from being broken at a page break. Placing the \interlinepenalty=10000 just before the bibliography would restrict the action to that section. Feb 18, 2020 at 4:49
  • Thanks kindly for the comment. I really forgot to check how the command interferes with the rest of the text. I edited to include a brief example of your comment.
    – FHZ
    Feb 18, 2020 at 13:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .