Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-24-2014, 09:58 PM   #1
bgoldnyxnet
Junior Member
bgoldnyxnet began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2014
Location: Los Angeles
Device: Calibre
How to prevent page breaks?

I'm converting a trilogy of books to EPUB format. I did the first book with relatively little trouble, because it's mostly text with some minor formatting (some italics and boldface, a couple of chunks in boxes). By some good luck, all the boxes land in the middle of a page, so there's no problem with page breaks.

But the second book has much more boxed text. Some of it is just in boxes to represent it appearing on a monitor, and some is tabular material with boxes around and between the cells. When I look at the HTML with a browser, it looks fine. But when I convert it to EPUB and look at it in an EPUB viewer, some of those boxes end up crossing a page boundary, so that the top part of the box is at the bottom of a page and the bottom part is at the top of the next page.

This isn't what I want, at all. I have tried adding page-break-within:avoid, but that doesn't seem to affect things at all. My boxed tables still end up split between pages.

So I guess my first question is: who/what makes the decision over where to split pages? Is it the program that converts from HTML to EPUB? Or is it the EPUB viewer.

If the viewer, is there any way to convince the viewer that it should not put a page break in the middle of a (particular) paragraph and/or table? If so, how?

If the conversion, is there a better way to convince the conversion program (I'm using Calibre) to not put a page break in a table. Or if not, is there some other conversion program that _will_ follow my directions in this regard?
bgoldnyxnet is offline   Reply With Quote
Old 01-25-2014, 12:49 AM   #2
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
I think we'll need a look at your HTML/CSS.

I have no problem preventing poetry verses from breaking in if I put page-break-inside:avoid in a div which surrounds the verse.
AlexBell is offline   Reply With Quote
Old 01-25-2014, 07:36 AM   #3
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
It sounds like you are using tables. This can be a headache.

One way around it which will work, but not be the appearance you want is to put these boxes in their own section. This would force a new page before and after.

You can break the text up into sections in an editing program like Sigil or the new editing function of calibre.
mrmikel is offline   Reply With Quote
Old 01-25-2014, 09:37 AM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Bottom line is: don't use tables unless you need to present tabular data (and even then, seriously consider not doing it).

Boxes aren't likely necessary (or very effective) to "represent appearing on a monitor." Consider simply using a monospace font (and different vertical spacing) for differentiating the sections that are to represent text on a screen. Less is best.

The steps to avoid a page-break are all well and good, but the fact of the matter is: you can't guarantee it won't happen (say for the user who requires a huge font-size), so don't dwell on it overly. The reading app will break where it deems necessary whether you like it or not (and each app, and/or user settings) will be different).
DiapDealer is offline   Reply With Quote
Old 01-27-2014, 11:49 AM   #5
Iznogood
Guru
Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.
 
Iznogood's Avatar
 
Posts: 932
Karma: 15752887
Join Date: Mar 2011
Location: Norway
Device: Ipad, kindle paperwhite
Quote:
Originally Posted by bgoldnyxnet View Post
I have tried adding page-break-within:avoid, but that doesn't seem to affect things at all. My boxed tables still end up split between pages.
I agree to what DiapDealer said. Just one thing: isn't it supposed to be page-break-inside:avoid? I have not found a css-style called page-break-within

Unfortunately, there is simply no way to guarantee that the page-break-properties will be followed. When I handle large tables or large boxes that are so large that the most likely will be split anyway, I usually put them in their own html-file, thus ensuring that they always start at a new page. If the reader software needs to break them, then so be it. It is impossible to avoid.
Iznogood is offline   Reply With Quote
Old 01-28-2014, 03:23 AM   #6
bgoldnyxnet
Junior Member
bgoldnyxnet began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2014
Location: Los Angeles
Device: Calibre
I have uploaded an abridged version of the file:
http://conchord.org/xeno/wbtest.htm

That has enough tables to let you see what's going wrong, I think.
bgoldnyxnet is offline   Reply With Quote
Old 01-28-2014, 03:32 AM   #7
bgoldnyxnet
Junior Member
bgoldnyxnet began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2014
Location: Los Angeles
Device: Calibre
I have changed the occurrences of "page-break-within" to "page-break-inside". Still no joy.

Tomorrow I'll change the stuff that is only in tables because I want boxes around them to use a div with a unique class instead. Other things will still be in tables because they really are tabular. See the tables on page 8, for example.

Obviously, I could force a page break before each such table, but that would lead to a lot of unnecessary page breaks, so I'd like to get the converter (or viewer) to keep these together _when possible_. A few of the tables are too long to fit on a single page; so be it. But the others I would like to avoid breaking across page boundaries, if I can.
bgoldnyxnet is offline   Reply With Quote
Old 01-28-2014, 06:51 AM   #8
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
One thing I have not seen mentioned here is the button which most readers have which increases the size of the text.

If someone uses it because they are older, or don't have their glasses that day, or have to hold it at some distance while on a bus/train, then the layout will change. It almost never changes favorably.

Unless you are in a position where you can force your reader to use a particular large screen device, then you are likely to have some trouble.
mrmikel is offline   Reply With Quote
Old 01-28-2014, 08:22 AM   #9
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,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
So, the proper way is "page-break-inside:avoid". You'll always be at the mercy of ebook readers respecting this or not, with bugs or not. Don't try to be over-smart and force some particular behaviour in some particular reader: it will fail miserably somewhere else. Keep it simple, do the right thing™ and blame the others when it doesn't work
Jellby is offline   Reply With Quote
Old 01-28-2014, 09:45 AM   #10
faltradl
Guru
faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.faltradl ought to be getting tired of karma fortunes by now.
 
Posts: 602
Karma: 1712372
Join Date: Feb 2013
Location: germany
Device: PocketBook Touch
It's a question of the readersoftware.

Yesterday I found the same problem. In the reader of Calibri it looks fine. Only page brakes where they are nessesary. So also inside the table cells.

Then I put it on my Pockebook Touch using CoolReader. To many page brakes, and at the wrong positions. CoolReader can do them only between the table cells.
faltradl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
prevent a bit of paragraph spilling over page turn cybmole Sigil 28 01-16-2014 09:42 AM
Help with page breaks? Greg7976 Sigil 4 05-27-2013 07:52 AM
Page Breaks etc genfind General Discussions 6 02-24-2012 02:20 PM
epub to mobi h1 page breaks not starting on new page wannabee Conversion 4 08-02-2011 12:46 AM
Adding page breaks in Calibre breaks ePubcheck validation bookraft Conversion 16 03-01-2011 01:23 PM


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


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