![]() |
#1 |
Member
![]() Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
|
Widows & Orphans won't disappear
Hello!
I'm trying to get rid of widows and orphans in a poetry ebook. I've set their value to 1 in the CSS editor but they still appear in both epub and kepub format. Any insights? Thanks! |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I'm not sure what you mean by "won't disappear". As you are talking about poetry, my guess is you are trying to to keep each verse together and not split them over a page break. If so, using 1 for widows and orphans would be the worst thing you could.
A "1" for widows and orphans means to allow a single line as either a widow or orphan. That will maximise the text on a screen. Using "2" means that you have to have at least two lines together in the paragraph at the end of the page or top of the next. Which means a three line paragraph that goes over the end of a page will always move to the next page, but a four line paragraph might have two on each page. If you are trying to keep each verse together and you are using a paragraph for each verse with a br tag for the lines, then setting the widows and orphans to the one higher than half of the number of lines in the longest verse should work. But, I'd be lazy and just set it to the number of lines in the longest verse. I haven't tried it, but, it should work. Or at least it should in epubs for any reader that is based on the Adobe RMSDK, which the epub reader on a Kobo device is. This won't work for kepubs. The renderer for kepubs does not do any widows and orphans calculations. So, nothing will work there. And, I expect a lot of other epub renders do the same thing. If I have misunderstood what you are doing, then we need more information on what you are doing and what is not working. Sample code is always good and screenshots to show what it looks like will help. Also, questions like this would be much better in the Workshop section of the forum. The real experts on creating ebooks hang out there. I know there has been discussion of how best to do poetry, but, it isn't my thing. The above is my guess based on my understanding of how widows and orphans work. Someone there will be able to tell you what the best thing to do is. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
|
Thank you so much @davidfor, this clarifies many things. This is not a book I'm writing, it's a book I'm tweaking to read it seamlessly.
I've set it up to 5 and it seems to work, but I had to dig for the right place... Just FYI, posting it here: This is an example of a 3-line verse whose last word always ends up as an orphan (I've spread it over several lines here but it's continuous): Code:
<p class="paraCenter" style="text-indent: 0%"><span> <span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.75.1">The beauty of dried flowers, how can they</span> <br/><span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.76.1">compare to</span> <br/><span xmlns="http://www.w3.org/1999/xhtml" class="koboSpan" id="kobo.77.1">Him?</span></span></p> Code:
.paraCenter { display: block; text-align:center; widows:5; orphans:5; |
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,046
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
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. Any other number means TRY to accomplish (there are ALWAYS cases ![]() |
![]() |
![]() |
![]() |
#5 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,117
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
A while back, I played around with widows/orphans set to 0 and various renderers. About half treated 0 as being the same as 1 while the other half went for their default of 2 or 3.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Member
![]() Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
|
Quote:
Code:
body, div, h1, h2, h3, h4, h5, h6, p { widows:5; orphans:5; } ![]() |
|
![]() |
![]() |
![]() |
#7 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
![]() ![]() Quote:
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:
(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> 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> 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> Code:
div.poem { page-break-inside: avoid; } div.stanza { page-break-inside: avoid; } Code:
div.poem { page-break-before: always; } div.stanza { page-break-inside: avoid; }
The 2nd CSS will tell a device:
Both of them also say:
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:
There's tons of bogus widow/orphan info floating around out there. 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. Code:
This is an example paragraph
that would stay on the same
(page break can happen here)
page.
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. In Ebooks, nearly everything can be variable:
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:
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:
(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. Last edited by Tex2002ans; 01-21-2022 at 11:56 PM. |
|||
![]() |
![]() |
![]() |
#8 |
Member
![]() Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
|
@Tex2002ans your poetry is fantastic
![]() Thank you for this wealth of information, this has been of immense help! |
![]() |
![]() |
![]() |
Tags |
orphans, widows |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Widows and Orphans | jhowell | Kindle Formats | 89 | 08-26-2021 10:38 PM |
Widows and Orphans | jonathanc | Amazon Kindle | 13 | 05-23-2020 02:32 AM |
Widows and Orphans | Waylander | Kobo Reader | 31 | 05-18-2020 06:54 AM |
using widows & orphans | cybmole | Sigil | 11 | 05-16-2011 01:07 AM |
Widows and Orphans | danrodney | ePub | 10 | 12-08-2010 02:08 PM |