Is it possible to prevent line breaks inside bibliography entries? I assume this would be similar to telling TeX not to break the page during a list entry as well.
LaTeX usually does a pretty good job of keeping short entries together on a page, but in this particular document I may actually need it to break the pages so as to keep the entries from being split across pages, even if doing so requires lots of white space at the end of a page.
Page Layout ⇒ Preventing page breaks during bibliography entries
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Preventing page breaks during bibliography entries
I see two possible solutions which may work separately or have to be combined.
A global solution would be to avoid widows and orphans by special settings in the preamble [1].
These settings inhibit widows and orhpans completely.
A local solution would be to enlarge the concerned page by one or more lines.
This line has its place right after the beginning of the bibliography.
[1] Widows and orphans - Wikipedia, the free encyclopedia
A global solution would be to avoid widows and orphans by special settings in the preamble [1].
Code: Select all
\clubpenalty10000
\widowpenalty10000
A local solution would be to enlarge the concerned page by one or more lines.
Code: Select all
\enlargethispage{2\baselineskip}
[1] Widows and orphans - Wikipedia, the free encyclopedia
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Re: Preventing page breaks during bibliography entries
It isn't a question of putting one or two lines on the next page; that problem is solved by setting the club and widow penalties.
In this case, the requirement is that NO entry (regardless of length) be split across a page. For example, say LaTeX wants to split one entry across the page with 10 lines on the first page and three on the second.
I've tinkered with the idea of putting every entry in the bibliography in its own \parbox, but this seems likely to cause problems with page breaks due to the penalty of both not breaking the parbox and not leaving lots of white space at the bottom of the page (the white space would be OK, the overrun of the parbox would not).
In this case, the requirement is that NO entry (regardless of length) be split across a page. For example, say LaTeX wants to split one entry across the page with 10 lines on the first page and three on the second.
I've tinkered with the idea of putting every entry in the bibliography in its own \parbox, but this seems likely to cause problems with page breaks due to the penalty of both not breaking the parbox and not leaving lots of white space at the bottom of the page (the white space would be OK, the overrun of the parbox would not).
Preventing page breaks during bibliography entries
@kaiserkarl13: looking at your initial request (and to the suggestion by localghost, that you dismissed) and taking into account your following reply (that addresses such a particular issue), then can't you just simply manually edit the corresponding files? (Again, your requests seem to be of such a particular nature that I don't see any general use for them).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Re: Preventing page breaks during bibliography entries
I'm trying to generate a modification to the document class that satisfies this type of requirement (hence the desire to do it globally instead of on a per-case basis). Based on my reading, this seems like a difficult problem to solve except on a per-case basis, so that may be the way it gets resolved.
The needspace package provides a partial solution by saying, to effect, "if there is 13\baselineskip [or however many lines that entry will need] of space available, put it here; otherwise, start a new page." It's essentially this feature that I'm looking for, but you'd have to know how many lines each entry is going to need to implement this globally.
I thank everyone for their speculation on this subject.
The needspace package provides a partial solution by saying, to effect, "if there is 13\baselineskip [or however many lines that entry will need] of space available, put it here; otherwise, start a new page." It's essentially this feature that I'm looking for, but you'd have to know how many lines each entry is going to need to implement this globally.
I thank everyone for their speculation on this subject.