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, 04: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: 2,391
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
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 online now   Reply With Quote
Old 09-01-2014, 04: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: 6,259
Karma: 4801165
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
 
Advertisement
Old 09-01-2014, 06: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: 2,391
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
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 online now   Reply With Quote
Old 09-01-2014, 06: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: 6,259
Karma: 4801165
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, 07: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: 2,391
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
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 online now   Reply With Quote
Old 09-01-2014, 08: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: 6,259
Karma: 4801165
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, 03: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: 2,391
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
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 online now   Reply With Quote
Old 09-01-2014, 04: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: 37,876
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
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 online now   Reply With Quote
Old 09-01-2014, 05: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: 6,259
Karma: 4801165
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, 05: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: 2,391
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
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 08:35 PM.
Ripplinger is online now   Reply With Quote
Old 09-01-2014, 09: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: 37,876
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
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 online now   Reply With Quote
Old 09-02-2014, 03: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: 2,391
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
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 online now   Reply With Quote
Old 09-02-2014, 08: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: 6,259
Karma: 4801165
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, 11: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: 2,391
Karma: 2368269
Join Date: Dec 2010
Location: Midwest USA
Device: Sony PRS-350: 3 Silver, 2 Blue!; Kobo Glo
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 11:30 AM.
Ripplinger is online now   Reply With Quote
Old 09-02-2014, 04:07 PM   #15
theducks
Grand Sorcerer
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: 15,096
Karma: 5939999
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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 03:55 AM
Touch Dark lines between lines of text taming Kobo Reader 12 06-13-2011 08:20 PM
Unutterably Silly Why lines? GlenBarrington Lounge 2 11-23-2010 10:23 AM
Lines on the screen nimblem Astak EZReader 5 05-18-2010 11:57 AM
Lines from TV that I can't forget Steven Lyle Jordan Lounge 82 06-13-2008 07:58 PM


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


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