Quote:
Originally Posted by davidfor
Also, questions like this would be much better in the Workshop section of the forum. The real experts on creating ebooks hang out there. [...] Someone there will be able to tell you what the best thing to do is.
|

Quote:
Originally Posted by fabianmoreno01
Just to be clear, I also changed the value there:
Code:
body, div, h1, h2, h3, h4, h5, h6, p {
widows:5;
orphans:5;
}
Anyways, as @theducks say, there are still cases  But overall it's much smoother!
|
No. Do not do this. This would be absolutely disastrous.
If someone changes the font size (or tries to read on a cellphone), the entire thing would break.
You shouldn't really mess with the widow/orphan settings at all... and if you ever do, it:
- should be done very selectively.
- should never go higher than 2 or 3.
(The default widows/orphans, for English, is 2/2. And it's that for a reason. See NOTE far below.)
- - -
You have better methods to accomplish what you want, depending on the layout of the book + how much work you're willing to put in.
Method #1: Split Each Poem Into Its Own HTML File
The easiest and "most reliable" way.
This
guarantees each poem will "start at a new page" on every device:
File #1:
Code:
<h2>Greatest Poem by Tex</h2>
<div class="poem">
<p class="poetry">This is a poem.</p>
<p class="poetry">This is a poem.</p>
<p class="poetry">And this is a poem.</p>
</div>
File #2:
Code:
<h2>Very Good Poem by Tex</h2>
<div class="poem">
<p class="poetry">A new poem.</p>
<p class="poetry">This is good.</p>
<p class="poetry">Very, very good.</p>
</div>
This gives you the best chance that the entire poem will fit on a single screen + not have any widows/orphans at all.
Method #2: CSS page-break
Wrap each poem + stanza in a <div>:
Code:
<div class="poem">
<div class="stanza">
<p class="poetry">This is a poem.</p>
<p class="poetry">This is a poem.</p>
<p class="poetry">And this is a poem.</p>
</div>
<div class="stanza">
<p class="poetry">And it continues.</p>
[...]
</div>
</div>
with this CSS:
Code:
div.poem {
page-break-inside: avoid;
}
div.stanza {
page-break-inside: avoid;
}
OR:
Code:
div.poem {
page-break-before: always;
}
div.stanza {
page-break-inside: avoid;
}
The 1st CSS will tell a device:
- "Hey, please try not to put a page break inside this poem."
The 2nd CSS will tell a device:
- "Hey, always put a page break right before this poem."
Both of them also say:
- "Hey, if you do have to split a stanza, please try to keep all these lines together."
The CSS is not 100% reliable like the HTML method, but
some/most devices out there should support this... if they follow the EPUB standards.
Note: page-break-before is much more supported.
page-break-inside is much less supported.
Note #2: I, personally, go with a variant of Method #2.
The poems/lyrics I work on are smackdab in the middle of non-fiction text, so I can't create separate HTML files for each one. They'll fall wherever they fall, so the best you can do is say to the device:
"Hey, please try to keep this poem/stanza together."
Quote:
Originally Posted by theducks
I won't tell you how many books I see with:
widows: 0
and / or
orphans: 0
ZERO is invalid according to the rules. One is means nothing needs to be done.
|
Correct. 0 is invalid. The setting must be 1 or higher.
There's tons of bogus widow/orphan info floating around out there.
- widows = # of lines at the top of page.
- orphans = # of lines at the bottom of page.
And this stands for:
"How many lines, minimum, do you want to stick together
if a page breaks in the middle of a paragraph?"
so imagine if you said:
"Keep at least 0 lines at the top of the page."
This makes no sense!
Note on Print + Ebook Widows/Orphans
In Print books, for centuries, widows/orphans have been 2/2.
Why? Readability. Plus, it's mostly intended to keep "single words" from appearing on a page all by themselves:
2/2:
Code:
This is an example paragraph
that would stay on the same
page.
1/1 can potentially lead to:
Code:
This is an example paragraph
that would stay on the same
(page break can happen here)
page.
Because people who design print books have
full control over the:
- layout
- page size
- fonts
- font size
- [...]
and they know
exactly where certain words will land... they can tweak and reword and shrink/stretch, trying to eliminate as many of these widow/orphan problems as they can.
In modern times, many typographers have become a little more lenient, and accept:
2/1:
Code:
This is an example paragraph
(page break can happen here)
that would stay on the same
page.
This still keeps the single word from flying to the next page.
In Ebooks, nearly everything can be variable:
- page size
- People read ebooks everything from skinny cellphones to huge monitors.
- fonts
- Users can pick whatever fonts they want.
- font size
- Readers can go anywhere from HUGE fonts to teeny tiny.
- margins
- Readers can override with 0 to HUGE.
- [...]
You'll have no idea where any text will land, so you'll just have to code the book well, cross your fingers, and hope for the best.
Because ereaders tend to be:
- much smaller than physical books
- read at much larger fontsizes
trying to keep large chunks of text together—like an entire poem—becomes a near-impossibility.
You want to code the book following best practices, then typically leave the rest on defaults.
Side Note: Messing around with the widows/orphans setting causes quite the ruckus.
For example, many ereaders default to using 1/1—to maximize the amount of text per screen + make sure the bottom margin is full.
A few years back, Amazon decided to randomly change their widows/orphans to 2/2—after a decade+ of people getting used to 1/1! Lots of people now saw "extra gaps" at the bottom of their screen, then thought:
- the chapter was ending!
- their device was glitched!
(For more info on that, see the famous
2019 thread: "Widows and Orphans")
Print does not have this problem, because you have 2 pages (Left/Right) visible at the same exact time.