Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 09-01-2014, 03:16 AM   #1
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
How to keep certain lines together?

When a chapter is also divided up into say a dozen sections, each with their own number, it often happens that the number of the next part is at the end of one page and the text starts on the following page. Is there something that can be added in the stylesheet that will force those 2 parts, the number and first paragraph of the new section, to always stay together?

What I've done in the past is to force a new page when there's a new section within a chapter, but some of them are very short and really don't need that. I'd be happy if I could find a way just to prevent the section number being split from the first paragraph of that section.

I've read about "page-break-before: avoid" (or use "always" if you want to force a page break), but that didn't work to keep the lines together.
Ripplinger is offline   Reply With Quote
Old 09-01-2014, 03:59 AM   #2
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
page-break-after:avoid in the section number is what should be used, but I don't think it works in ADE.
Jellby is offline   Reply With Quote
Advert
Old 09-01-2014, 05:05 AM   #3
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
I've tried various placements of the following just to see if any of them make a difference, but didn't have any luck so far:
page-break-before: avoid or always
page-break-after: avoid or always
page-break-inside: avoid or always

It just seems to be totally ignored in the epubs.
Ripplinger is offline   Reply With Quote
Old 09-01-2014, 05:48 AM   #4
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
page-break-before:always should work in the sense of forcing a pagebreak before the number, so that the section will start at the top of a page and it would be very unlikely to have another pagebreak right after that (unless the next element is a very large image, for example).

If it doesn't work, either there's some problem in the CSS (are you sure it's being used at all? can you make the number bold/italic/underlined?) or the reader is just ignoring pagebreaks, and as far as I know ADE does not do this.

(page-break-inside:always makes no sense)
Jellby is offline   Reply With Quote
Old 09-01-2014, 06:37 AM   #5
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
Yes, the stylesheet.css is definitely being used, I can change the formatting of the text to anything else, just not getting it to do the page-break-before (or after). I read about it, including the page-break-inside here and just tried them all to see if there would be any changes.

I've tried it on a Sony 350 and Kobo Glo, both seem to ignore the page-break, leaving the section number at the bottom of one page and the text starting on another.
Ripplinger is offline   Reply With Quote
Advert
Old 09-01-2014, 07:14 AM   #6
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Could you post a complete epub sample?
Jellby is offline   Reply With Quote
Old 09-01-2014, 02:19 PM   #7
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
It's not a public domain book, so I'm sure how much I can upload without issues. And without the entire book, just a sample of it most likely won't have an instance of where the number falls on one page and the text on another, it of course doesn't happen everytime there's a section number. But here's the code for a section including the title, if this will help at all:

Spoiler:

<body class="calibre">
<p class="calibre7"><span class="calibre11"><span class="bold1">X</span></span></p>

<div class="calibre6">
&nbsp;
</div>

<p class="calibre7"><span class="calibre11"><span class="bold1">X</span></span></p>

<div class="calibre6">
&nbsp;
</div>

<p class="calibre10"><span class="calibre8"><span class="bold1"><span class="calibre11">F</span></span>irst paragraph after new section to keep connected to the above number.</span></p>
</body>
</html>


And from the stylesheet:
Spoiler:

.bold1 {
font-weight: bold
}
.calibre {
display: block;
font-size: 1em;
padding-left: 0;
padding-right: 0;
text-align: justify;
margin: 0 5pt
}
.calibre6 {
display: block;
height: 16px
}
.calibre7 {
page-break-after:avoid;
display: block;
text-align: center;
text-indent: 0;
margin: 0
}
.calibre11 {
font-size: 1.29167em;
line-height: 1.2
}
Ripplinger is offline   Reply With Quote
Old 09-01-2014, 03:25 PM   #8
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: 73,645
Karma: 127838196
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 Ripplinger View Post
When a chapter is also divided up into say a dozen sections, each with their own number, it often happens that the number of the next part is at the end of one page and the text starts on the following page. Is there something that can be added in the stylesheet that will force those 2 parts, the number and first paragraph of the new section, to always stay together?

What I've done in the past is to force a new page when there's a new section within a chapter, but some of them are very short and really don't need that. I'd be happy if I could find a way just to prevent the section number being split from the first paragraph of that section.

I've read about "page-break-before: avoid" (or use "always" if you want to force a page break), but that didn't work to keep the lines together.
There's an easy solution to that problem. Just move the bits at the end of one XML into the next XML. Calibre's Book editor can help you with that.
JSWolf is offline   Reply With Quote
Old 09-01-2014, 04:05 PM   #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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Ripplinger View Post
Code:
<p class="calibre7"><span class="calibre11"><span class="bold1">X</span></span></p>

  <div class="calibre6">
    &nbsp;
  </div>

  <p class="calibre10"><span class="calibre8"><span class="bold1"><span class="calibre11">F</span></span>irst paragraph after new section to keep connected to the above number.</span></p>
Have you tried adding "page-break-after:avoid" to the calibre6 class too? And removing the <div> and cleaning up the code?
Jellby is offline   Reply With Quote
Old 09-01-2014, 04:49 PM   #10
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
Quote:
Originally Posted by Jellby View Post
Have you tried adding "page-break-after:avoid" to the calibre6 class too? And removing the <div> and cleaning up the code?
I just tried that now, and changed the <div> to <p class="calibre">&nbsp;</p> to not lose the spacing between lines, and still no change. Numbers can end up at the bottom of one page and the first paragraph is on the following page.


Quote:
Originally Posted by JSWolf View Post
There's an easy solution to that problem. Just move the bits at the end of one XML into the next XML. Calibre's Book editor can help you with that.
That's normally what I do, but in some instances there are so many smaller sections within chapters, it would means having over 100 files when 28 is more than enough. And when always forcing a new page, you can end up with a lot of blank space on the preceding page, which some people don't like. That's why I was looking for another way to handle those without having to force a new page for each new section.

Edit: I also tried condensing all the various styles more and using only one style for the section numbers (instead of having 3 or different styles) and having page-break-after:avoid in that one and still no difference when transferred to the ereader.

Last edited by Ripplinger; 09-01-2014 at 07:35 PM.
Ripplinger is offline   Reply With Quote
Old 09-01-2014, 08:27 PM   #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: 73,645
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I don't think it will work other then my way of moving content around in the XML files. ADE starts a new page when it opens a new XML file.
JSWolf is offline   Reply With Quote
Old 09-02-2014, 02:57 AM   #12
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
I'm beginning to think you're right, that the only guaranteed way is to force each section onto a new page by having it on its own file, because nothing I try is making any difference at all to keep the first paragraph with the section number.
Ripplinger is offline   Reply With Quote
Old 09-02-2014, 07:16 AM   #13
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,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I still think forced pagebreaks ("always") should work, even if "avoid" may not. Can you reduce the book and use some replacement text so that you can post a sample epub that shows the problem (page-break-before:always being ignored)?
Jellby is offline   Reply With Quote
Old 09-02-2014, 10:13 AM   #14
Ripplinger
350 Hoarder
Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.Ripplinger ought to be getting tired of karma fortunes by now.
 
Ripplinger's Avatar
 
Posts: 3,574
Karma: 8281267
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350, Kobo Glo & Glo HD, PW2
I just tested more with page-break-before:always and page-break-after:always and both work. Not exactly what I wanted but it's better than nothing to avoid having 100 files within the epub.

You would think if there's a way to say yes to the line, that there should be a way say no.

Last edited by Ripplinger; 09-02-2014 at 10:30 AM.
Ripplinger is offline   Reply With Quote
Old 09-02-2014, 03:07 PM   #15
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Ripplinger View Post
I just tested more with page-break-before:always and page-break-after:always and both work. Not exactly what I wanted but it's better than nothing to avoid having 100 files within the epub.

You would think if there's a way to say yes to the line, that there should be a way say no.
And why are you trying to avoid that?
Performance should SOAR because any Zoom (font size) change on many devices only has to render the current page with smaller files.
theducks is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Those gray lines... ManDay Onyx Boox 16 09-09-2013 02:55 AM
Touch Dark lines between lines of text taming Kobo Reader 12 06-13-2011 07:20 PM
Unutterably Silly Why lines? GlenBarrington Lounge 2 11-23-2010 09:23 AM
Lines on the screen nimblem Astak EZReader 5 05-18-2010 10:57 AM
Lines from TV that I can't forget Steven Lyle Jordan Lounge 82 06-13-2008 06:58 PM


All times are GMT -4. The time now is 11:16 AM.


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