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 01-19-2022, 04:22 PM   #1
fabianmoreno01
Member
fabianmoreno01 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
Inserting page breaks before headings

Hello!

I'm reading a book which is mostly short-form poetry and I'd like each poem to start on a new page. (I'm on a Kobo Aura One with Calibre 3.48 as my Mac is running on High Sierra.)

I've tried adding the following piece of code:

Code:
page-break-before: always;
at the following position:

Code:
h1, h2, h3, h4, h5, h6 {
	page-break-before: always;
	font-weight: normal;
	font-style: normal;
	text-align: left;
	page-break-after: avoid;
}
I'm not getting any change when I load the ebook back on the Kobo. Is it a coding problem or an upload issue? (Also, I'd probably need it only for h4-5-6 or something like that, though I'm not sure how to know exactly.)

Thank you!
fabianmoreno01 is offline   Reply With Quote
Old 01-19-2022, 04:23 PM   #2
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
20 lashes with a wet noodle for making a duplicate post.
hobnail is offline   Reply With Quote
Advert
Old 01-19-2022, 04:25 PM   #3
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,586
Karma: 14328510
Join Date: Nov 2019
Device: none
Looks like a moderator deleted your other duplicate post with my answer in it.

Put each poem in its own file, that's sure to work. Maybe not the answer you wanted.
hobnail is offline   Reply With Quote
Old 01-19-2022, 05:13 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by fabianmoreno01 View Post
I'm not getting any change when I load the ebook back on the Kobo. Is it a coding problem or an upload issue?
It might be a book format issue. I seem to remember that some CSS is ignored by kepubs.
Code:
page-break-before: always;
being an example of this. However, it should work OK with standard epubs.

@hobnail's solution will work for both epub and kepub.
jackie_w is offline   Reply With Quote
Old 01-19-2022, 05:22 PM   #5
Moonbase59
Groupie
Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.Moonbase59 can program the VCR without an owner's manual.
 
Moonbase59's Avatar
 
Posts: 165
Karma: 196896
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
Just a side note: For some odd reason, page-break-after is often much better supported than page-break-before.
Moonbase59 is offline   Reply With Quote
Advert
Old 01-20-2022, 03:44 AM   #6
fabianmoreno01
Member
fabianmoreno01 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
Thanks folks!

This seems to be a problem with the kepub format, as in epub it displays the page breaks correctly after my initial code injection.

Is there any way to make sure this formatting stays active when converting to kepub?

(I currently use the web version of Kepubify and I can't use the KoboTouchExtended plugin on my old OS.)

Last edited by fabianmoreno01; 01-20-2022 at 03:46 AM.
fabianmoreno01 is offline   Reply With Quote
Old 01-20-2022, 04:43 AM   #7
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by fabianmoreno01 View Post
Thanks folks!

This seems to be a problem with the kepub format, as in epub it displays the page breaks correctly after my initial code injection.

Is there any way to make sure this formatting stays active when converting to kepub?
If the kepub renderer doesn't support it, then it doesn't support it. kepubify will not be removing it. But, if you want to check, simply put the epub on the device and change the extension to ".kepub.epub". Most of what kepubify or the extended driver does is to add spans. They don't remove any CSS.

But, Kobo actually state they don't support them on the devices. See https://github.com/kobolabs/epub-spec and search for page break. They recommend starting a new HTML file if you need a page break.
davidfor is offline   Reply With Quote
Old 01-20-2022, 05:21 AM   #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: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Another solution is to read ePub which does support page breaks.
JSWolf is offline   Reply With Quote
Old 01-20-2022, 07:32 AM   #9
fabianmoreno01
Member
fabianmoreno01 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
Thanks y'all, with a special shoutout to @davidfor for letting me know what kepub won't support. This just saved me a lot of frustration!
fabianmoreno01 is offline   Reply With Quote
Old 01-20-2022, 09:34 AM   #10
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: 79,745
Karma: 145864619
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 fabianmoreno01 View Post
Thanks y'all, with a special shoutout to @davidfor for letting me know what kepub won't support. This just saved me a lot of frustration!
Why not read your poetry in ePub? You get better typesetting and page breaks work.
JSWolf is offline   Reply With Quote
Old 01-21-2022, 01:32 AM   #11
fabianmoreno01
Member
fabianmoreno01 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
Quote:
Originally Posted by JSWolf View Post
Why not read your poetry in ePub? You get better typesetting and page breaks work.
@JSWolf I just switched to that for this exact reason. It's just a little slower but at least I get better quality.
fabianmoreno01 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting page breaks before headings fabianmoreno01 Kobo Developer's Corner 3 01-23-2022 03:13 PM
Inserting Page Breaks At Chapters Reader Bill Editor 9 09-20-2019 08:29 AM
ebook-convert (docx->html) inserting too many page breaks xanguera Conversion 3 07-31-2015 08:05 PM
Level 2 headings without page breaks? RobertDDL Conversion 2 06-04-2015 06:40 AM
Kindle inserting page breaks? december Calibre 8 07-15-2010 09:47 AM


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


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