Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 06-04-2021, 09:49 AM   #1
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
epub 2 pdf widowed <h2> solution sought

It is my understanding that GTK does not honor widows because of "columns". I do not understand the ins and outs of the technicalities. I find <h2>heading</h2> at the bottom of pdf pages. When I designate break-inside: avoid this only treats the <h2> tag itself and, of course, does not break, but it is still at page bottom. If I wrap the <h2> pair and the following <p> tag with a <div> I can tell the <div> not to break and that works okay. But it is laborious to go through and do this manually for every <h2>. To avoid adding divs throughout the book I tried to 'group' with a combinator in a goofy way: <style>(h2+*) {page-break-inside: avoid}</style>. That does not work. I cannot see using :before, :after, :first-pudknocker, or anything else. To say it cutesy-wootsie, I am looking for a way to affect 'the antecedent of an adjacent sibling selector of a combinator'. Would appreciate input. Best regards, Pop
Attached Thumbnails
Click image for larger version

Name:	widow2.png
Views:	161
Size:	672.6 KB
ID:	187478   Click image for larger version

Name:	widows3.png
Views:	155
Size:	439.9 KB
ID:	187479   Click image for larger version

Name:	widows4.png
Views:	188
Size:	684.7 KB
ID:	187480   Click image for larger version

Name:	widow1.png
Views:	161
Size:	469.5 KB
ID:	187481  
rjwse@aol.com is offline   Reply With Quote
Old 06-04-2021, 10:21 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Am confused, if you dont want the h2 at the bottom why not just put a page break before it?

h2 { page-break-before: always }

and page-break-inside requires a container to apply to the inside of it, so if you want to use it you have to wrap the stuff you want to use it on in a div
kovidgoyal is offline   Reply With Quote
Old 06-04-2021, 04:25 PM   #3
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,158
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Only Page Break Before a heading is reliable. I always use level 1 to 3 with Break Before. That also helps TOC generation.
I use styles that map to CSS that only look like headings if I don't want a page break or don't want it in the TOC.
Quoth is offline   Reply With Quote
Old 06-05-2021, 08:09 AM   #4
rjwse@aol.com
Addict
rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.rjwse@aol.com ought to be getting tired of karma fortunes by now.
 
rjwse@aol.com's Avatar
 
Posts: 283
Karma: 2228060
Join Date: Dec 2013
Location: LaVernia, Texas
Device: kindle epub readers on android
widows of h2 in pdf

Thanks for input. Regarding your question:"why not just put a page break before it?
h2 { page-break-before: always }" it is because the h2 segments are extremely short and look wrong if only one is on a page, but look good if bunched together as many as possible per page, but look bad with a widowed h2. The h2s show up good in the TOC.

I mentioned in the questions that wrapping h2s and following Ps in a DIV certainly works and you said so:"and page-break-inside requires a container to apply to the inside of it, so if you want to use it you have to wrap the stuff you want to use it on in a div"

I was trying to find an elegant solution of no widows of h2 without wrapping all h2+ps. Basically, I'm learning the ins and outs of how to solve programming css limitations. Thanks for the help. Best regards, Pop
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2021-06-05 06-50-24.png
Views:	152
Size:	204.0 KB
ID:	187505   Click image for larger version

Name:	Screenshot from 2021-06-05 06-46-55.png
Views:	152
Size:	174.0 KB
ID:	187506  
rjwse@aol.com is offline   Reply With Quote
Old 06-06-2021, 06:04 PM   #5
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by rjwse@aol.com View Post
When I designate break-inside: avoid [...]
If you're aiming for EPUB2 + older ereaders, you'd use:

Code:
page-break-inside: avoid
CSS2 = page-break-inside
CSS3 = break-inside

break-inside is a relatively recent renaming, so a lot of older devices/readers won't recognize that.

Quote:
Originally Posted by rjwse@aol.com View Post
I find <h2>heading</h2> at the bottom of pdf pages. [...] this only treats the <h2> tag itself and, of course, does not break, but it is still at page bottom.
I think I came up with something. (See below.)

Related Side Note: There are a few bleeding edge things in CSS3 Paged Media that deal with floats (mostly for Images+Captions/Figures/Tables/Sidebars).

It would allow those chunks to move to the top/bottom of next page, while the rest of the text fills the previous page.

I explained some of that here:

"Kindle Previewer 3.40 - 64bit, SVG text, snap-block" (Post #3+)

Quote:
Originally Posted by rjwse@aol.com View Post
Regarding your question:"why not just put a page break before it?

h2 { page-break-before: always }" it is because the h2 segments are extremely short and look wrong if only one is on a page, but look good if bunched together as many as possible per page,
If that screenshot is an example of your book... then I'd tackle it like this.

1. Wrap every "little section" in its own <section>:

Before:

Code:
<h2>Sample Heading</h2>
<p>Short and sweet paragraph.</p>
<p>Another short paragraph.</p>
HTML5:

Code:
<section class="chunk">
	<h2>Sample Heading</h2>
	<p>Short and sweet paragraph.</p>
	<p>Another short paragraph.</p>
</section>
2. Now you can apply CSS to your <section>s:

Code:
section.chunk {
	page-break-inside: avoid;
}
That should accomplish what you want, but it would only work in readers that understand <section> (so HTML5 = EPUB3 + newer readers).

And I think this is one of those cases where you can do your best to code it, then it's up to the readers themselves to be using a standards-compliant reader.
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Widowed (Orphaned?) Header SigilBear ePub 11 02-12-2017 12:12 AM
PDF images upside down - a solution Fingerstoo Conversion 4 12-21-2011 11:57 AM
Possibly a solution to one of the pdf conversion problems alansplace Conversion 0 12-20-2011 03:14 PM
Zooming:PDF's ultimate solution? el.astrologo Sony Reader 7 06-16-2009 10:34 AM
Favourite PDF solution? Vero PDF 4 04-21-2007 05:46 PM


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


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