MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   ePub (https://www.mobileread.com/forums/forumdisplay.php?f=179)
-   -   Is there an option for Paragraph breaking between pages (might be wrong term for it) (https://www.mobileread.com/forums/showthread.php?t=289135)

Veelk 07-30-2017 09:03 PM

Is there an option for Paragraph breaking between pages (might be wrong term for it)
 
Okay, so one thing I would like to have is have the reader automatically detect when a paragraph will enter into the next page, so it always ends on the last complete sentence. Here's what I mean.

http://i.imgur.com/iCiFK3g.png
http://i.imgur.com/73pPmGz.png

What I want it to be like is this:

http://i.imgur.com/7lSdbtI.png
http://i.imgur.com/4VynjLT.png

I can understand this is impossible for books where the paragraphs are simply longer than the page screen size, but I would love to have it as an option. It just feels so much cleaner and I would improve my reading experience a lot.

theducks 07-30-2017 09:27 PM

Widows
orphans
are the key words.

But not all devices behave :(

Veelk 07-31-2017 11:06 AM

I didn't understand what you meant at first. I tried googling it, and it's apparently something you put into the user stylesheet section of preferences? I'm sorry, but I have very little experience with programming of any kind. I tried putting in a variety of codes, but nothing is making any difference. Can you go into more depth on what I'm supposed to do?

JSWolf 07-31-2017 11:08 AM

Even diddling with windows and orphans, it cannot be done. You cannot get the break to be what the OP wants.

BetterRed 07-31-2017 07:13 PM

Quote:

Originally Posted by JSWolf (Post 3561073)
Even diddling with windows and orphans, it cannot be done. You cannot get the break to be what the OP wants.

Surely it depends on the viewer.

My epubs have page-break-inside : avoid in body paragraph styles. If I put the calibre viewer in paged mode then paragraphs don't flow across 'pages', or columns. One of my Android apps honours the css code and another one doesn't - I forget which, because whether they do or not doesn't bother me.

BR

davidfor 07-31-2017 10:03 PM

Quote:

Originally Posted by JSWolf (Post 3561073)
Even diddling with windows and orphans, it cannot be done. You cannot get the break to be what the OP wants.

You can't guarantee it, but if you set them to a number higher than the length of any paragraphs in the book, it will probably work.

Note: Yes, it all depends on the font size, line spacing, screen size etc. But, for a person doing this on their one device who knows what their personal preferences are, they can work it out. And yes, I have tried some silly numbers on my Kobo devices a while back and it worked as expected.

HarryT 08-01-2017 03:03 AM

This is an ePub coding question and has nothing whatsoever to do with Calibre. Moved to the ePub forum.

Veelk 08-01-2017 06:28 AM

Sorry about it being in the wrong place.

As I said before, you guys are basically going to have to walk me through all this as though I were 5 years old. You can basically assume I don't know anything about anything in this regard.

Though from what JSWolf seems to be saying, it just can't be done at all? Or do I need to do something to make it work? Because no matter what I put into CSS, the Widow-orphan isn't making any kind of difference for me.

HarryT 08-01-2017 07:12 AM

You want something like this in the paragraph style in your CSS:

Code:

p {
  widows: 2;
  orphans: 2;
}

That tells it to move the entire paragraph to the next page if there would two (or fewer) lines left either at the bottom of one page, or the top of another.

JSWolf 08-01-2017 07:27 AM

But, the problem is that with long paragraphs, 2 & 2, it won't work reliably. I have not tried using higher numbers.

HarryT 08-01-2017 07:29 AM

Quote:

Originally Posted by JSWolf (Post 3561572)
But, the problem is that with long paragraphs, 2 & 2, it won't work reliably. I have not tried using higher numbers.

Well, of course some reading apps and devices may not implement it particularly well, but the code I posted is the correct way to do it. All these attributes are "requests" to the rendering engine, rather than absolute "commands".

JSWolf 08-01-2017 08:12 AM

Quote:

Originally Posted by HarryT (Post 3561573)
Well, of course some reading apps and devices may not implement it particularly well, but the code I posted is the correct way to do it. All these attributes are "requests" to the rendering engine, rather than absolute "commands".

The problem is that the OP wants to end on a complete sentence. That's not possible to do without maybe dropping the last paragraph to the next page and that could leave a rather large gap. And depending on the size of the screen, I've seen a paragraph take up the entire screen.

Notjohn 08-01-2017 08:57 AM

As a reader, I have no problem with widows & ophans. I would much rather continue reading from one page to the next, as I do in a print edition, without encountering a short page. If I am reading a print edition from a reputable publisher, the book designer is going to tweak the line spacing, or perhaps ask the author to rephrase, rather than have pages of unequal length. I appreciate that the OP in a sense is trying to accomplish what book designers accomplish, but Kindle at least is going to make a hash of it. (And ending a paragraph with the last complete sentence is going to make a new paragraph, isn't it? Does the carry-over get an indent, and how is that accomplished? And what if we're talking about a paragraph that is quoted speech -- who adds the beginning quotation mark?)

HarryT 08-01-2017 09:34 AM

There is no way of moving "sentences" from one page to another. Widow and orphan control is for moving entire paragraphs between pages.

JSWolf 08-01-2017 09:35 AM

Quote:

Originally Posted by Notjohn (Post 3561605)
Does the carry-over get an indent, and how is that accomplished? And what if we're talking about a paragraph that is quoted speech -- who adds the beginning quotation mark?)

The carry-over does not get an indent if it's part of the paragraph that starts on the previous page. If it's a quoted paragraph, then the quotes are where they belong.


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

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.