Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 09-12-2026, 02:21 PM   #1
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 282
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
What can invisibly cause a pagebreak?

I have an epub file and can't figure out what's causing a pagebreak.

Code:
<p class="noindent2">In the dungeons, the Queen sat in near perfect darkness. She had one window, high in the wall of her cell, and it allowed in some light during the day. She had a bed, and wall hangings and clean linen, and excellent food.</p>
<p class="indent">And very careful guards. She didn’t know any of them, despite their red surcoats. But they were cautious and courteous.</p>
On my Kobo, after that noindent2 paragraph there's a pagebreak. But there's no reason for it in the css. noindent2 is used in a thousand other places just fine without creating a pagebreak, and the indent class after it is used for most paragraphs in the book, it doesn't cause a pagebreak anywhere else either.

Code:
.noindent2 {
  display: block;
  font-size: 1em;
  line-height: 1;
  text-align: justify;
  text-indent: 0;
  margin: 1em 0 0 0;
}
.indent {
  display: block;
  font-size: 1em;
  line-height: 1;
  text-align: justify;
  text-indent: 1em;
  margin: 0;
}
I created a noindent3 just for that paragraph, but that made no difference to the pagebreak. I can do anything else as usual - change the margins for the paragraph, etc - but the pagebreak appears whatever I do. I tried page-break-after: avoid, and tried adding page-break-before: avoid to the basic indent rule. Made no difference.

Aside from the ones I added, there's no page-break rule anywhere in the stylesheet.

In the Calibre Editor and in Sigil, there is no other code around that paragraph. In the Calibre Viewer/Sigil preview, there's no pagebreak visible. But in Adobe Digital Editions, and on my Kobo, there's a pagebreak there.

I have widows and orphans removed from the stylesheet, so it's not that.

So - what can cause a pagebreak in an epub file, without a page-break-after rule or visible bit of code around a given paragraph? What should I be looking for?

This is all with EPUB, not KEPUB, if that's relevant.

Also, I'm not great with terminology etc, so please explain any theories like I'm 5!
Siavahda is offline   Reply With Quote
Old 09-12-2026, 02:29 PM   #2
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 282
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Also, because it has sometimes helped with issues like this in the past, I converted the file to AZW3, but the Calibre Editor still didn't show me any code that would explain the pagebreak.
Siavahda is offline   Reply With Quote
Old 09-12-2026, 02:44 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,502
Karma: 21099999
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
One possibility - you might try looking at the widows/orphans setting. Under ePub 2 you can set that and it can have the effect of pushing sentences to the next page - which looks a lot like a page break.
If you are using ePub 3 that wouldn’t be in the css, but it may be a default in your Kobo??? Others here are more knowledgeable about koboisms.

Cheers,
Turtle91 is offline   Reply With Quote
Old 09-12-2026, 04:24 PM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,900
Karma: 9600930
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Following on from the comment by Tuttle91, if you change the font size on your kobo, does the page break still occur at the same place or does it move with the changing font size?

If it stays at the same place, we'd need to see the ebook in total.
Karellen is offline   Reply With Quote
Old 09-12-2026, 05:05 PM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 84,893
Karma: 153788249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
@Siavahda, put the following code in your CSS. One thing to do is for every class that has a center, make sure text-indent: 0; is in those classes. If you already have body and p, replace them. See if this fixes your problem.

Code:
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
p {
  margin-top: 0;
  margin-bottom: 0;
  widows: 1;
  orphans: 1;
  text-indent: 1.2em;
}
JSWolf is offline   Reply With Quote
Old 09-12-2026, 09:32 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,502
Karma: 21099999
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Siavahda View Post
...

I have widows and orphans removed from the stylesheet, so it's not that.

...
Even if this is not explicitly set in your stylesheet, it could be a kobo default. I'm not sure how to address that in a Kobo, but JSWolf uses one. I'd try adding the css he suggested...and maybe even try adding the !important tag at the end:

widows: 1 !important;
orphans: 1 !important;


Of course, try the Font-size change test Karellen mentioned first...that would rule out widows/orphans.
Turtle91 is offline   Reply With Quote
Old Yesterday, 02:59 AM   #7
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 282
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Widows and orphans rules are removed from all my ebooks during conversion, and my Kobo configuration file has widows: 1 and orphans: 1. I don't see how it could be a widows/orphans issue.

@Karellen, yes the break stays in the same place with font size changes. I don't know how to share the file without copyright issues? If I scramble the file I don't know how to direct you to the problem paragraph.

@JSWolf I don't know what you mean by 'every class that has a center'. I suspect you don't mean text-align: center...
Siavahda is offline   Reply With Quote
Old Yesterday, 07:54 AM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,599
Karma: 22000001
Join Date: Jan 2008
Location: Spaniard in Germany
Device: Cybook Orizon, Kobo Aura
Too large a "chapter"? Try removing a few paragraphs from the beginning. Does the page break move a few paragraphs forward?
Jellby is offline   Reply With Quote
Old Yesterday, 08:31 AM   #9
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 282
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Quote:
Originally Posted by Jellby View Post
Too large a "chapter"? Try removing a few paragraphs from the beginning. Does the page break move a few paragraphs forward?
What the?! Yes, that worked!

Except that the pagebreak didn't move forward, OR backward; as far as I can tell it's vanished completely.

I split the chapter file into two html files, and that seems to have worked! THANK YOU. I had no idea chapter length could be an issue!
Siavahda is offline   Reply With Quote
Old Yesterday, 09:17 AM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 84,893
Karma: 153788249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
Even if this is not explicitly set in your stylesheet, it could be a kobo default. I'm not sure how to address that in a Kobo, but JSWolf uses one. I'd try adding the css he suggested...and maybe even try adding the !important tag at the end:

widows: 1 !important;
orphans: 1 !important;


Of course, try the Font-size change test Karellen mentioned first...that would rule out widows/orphans.
No need for !important.

The default on a Kobo for windows and orphans is 2. Most ePub software has a default of 2. And even if not, it's a good idea to have it in CSS so it gets the value you want.
JSWolf is offline   Reply With Quote
Old Yesterday, 09:20 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 84,893
Karma: 153788249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Siavahda View Post
Widows and orphans rules are removed from all my ebooks during conversion, and my Kobo configuration file has widows: 1 and orphans: 1. I don't see how it could be a widows/orphans issue.

@Karellen, yes the break stays in the same place with font size changes. I don't know how to share the file without copyright issues? If I scramble the file I don't know how to direct you to the problem paragraph.

@JSWolf I don't know what you mean by 'every class that has a center'. I suspect you don't mean text-align: center...
I do mean text-align: center;. Every CSS class that has that has to have a text-indent: 0; otherwise your centers will not be centered.

And you are wrong. The length of the chapter has nothing to do with pagebreaks. So put the chapter back as one.

Have you used to code I posted?

Last edited by JSWolf; Yesterday at 09:22 AM.
JSWolf is offline   Reply With Quote
Old Yesterday, 09:21 AM   #12
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 282
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Quote:
Originally Posted by JSWolf View Post
I do mean text-align: center;. Every CSS class that has that has to have a text-indent: 0; otherwise your centers will not be centered.
Oh! Okay. That I do by default, yes, because obviously that messes up the centering. Can it also cause pagebreak issues?
Siavahda is offline   Reply With Quote
Old Yesterday, 09:23 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 84,893
Karma: 153788249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Siavahda View Post
Oh! Okay. That I do by default, yes, because obviously that messes up the centering. Can it also cause pagebreak issues?
That has nothing to do with pagebreaks. The only things that has to do with pagebreaks will show page-break.
JSWolf is offline   Reply With Quote
Old Yesterday, 09:24 AM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 84,893
Karma: 153788249
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
And you are wrong. The length of the chapter has nothing to do with pagebreaks. So put the chapter back as one.

Have you used to code I posted?
JSWolf is offline   Reply With Quote
Old Yesterday, 09:24 AM   #15
Siavahda
Addict
Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.Siavahda can eat soup with a fork.
 
Posts: 282
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
Quote:
Originally Posted by JSWolf View Post
That has nothing to do with pagebreaks. The only things that has to do with pagebreaks will show page-break.
...Then why did you mention it when the problem I posted about was pagebreaks?
Siavahda is offline   Reply With Quote
Reply

Tags
epub, pagebreak


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
unwanted pagebreak travger Conversion 3 05-04-2014 05:40 AM
h1 pagebreak without h2 bookdragon Sigil 5 03-03-2014 06:11 AM
HELP from Pagebreak !! Smashword Tara198 Writers' Corner 4 07-06-2013 06:22 PM
0.6.3 pagebreak before h2 only every second time? flowoeB Calibre 4 07-31-2009 01:47 AM
XPath Help and Pagebreak emellaich Calibre 3 07-28-2009 02:17 PM


All times are GMT -4. The time now is 08:41 PM.


MobileRead.com is a privately owned, operated and funded community.