04-24-2023, 08:11 AM | #1 |
Whatever...
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
|
Unwanted page breaks before headings level 2
I am using Calibre’s ebook-convert to convert htm files to epub:
ebook-convert xyz.htm xyz.epub --epub-inline-toc --level1-toc //h:h1 --level2-toc //h:h2 --page-breaks-before //h:h1 --language en The htm files have <h1>…</h1> and <h2>…</h2> chapter headings. It works perfectly well, with page breaks before <h1> headings, unless <h2> chapter titles begin with the words "Chapter" or "Book" — then I get unwanted page breaks before the level 2 headings. Is there a way to avoid this? |
04-24-2023, 09:28 AM | #2 |
Evangelist
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
|
You will get page breaks if the text is split between the files.
|
04-25-2023, 03:03 AM | #3 | |
Whatever...
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
|
Quote:
It might work to change "Chapter" to "Chupter" in the text, convert it to epub, unzip it, edit Chupter back to Chapter in the files that contain the text, and zip it again — but, that's a bit cumbersome and ridiculous, and I hope there is a simpler way? |
|
04-25-2023, 03:06 AM | #4 |
creator of calibre
Posts: 43,909
Karma: 22669818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Look in the structure detection section of the conversion dialog
|
04-25-2023, 04:36 AM | #5 | |
Whatever...
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
|
Quote:
<h2>1. Some Title</h2> does not result in a page break, while <h2>Chapter 1. Some Title</h2> does. How can I have level 2 chapter titles begin with "Chapter", without triggering a page break? |
|
04-25-2023, 04:37 AM | #6 |
creator of calibre
Posts: 43,909
Karma: 22669818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Change the detect chapters expression to / or change the chapter mark to none.
|
04-25-2023, 08:16 AM | #7 | |
Whatever...
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
|
Quote:
The syntax I'm using is: ebook-convert xyz.htm xyz.epub --epub-inline-toc --level1-toc //h:h1 --level2-toc //h:h2 --page-breaks-before //h:h1 --language en |
|
04-25-2023, 10:47 AM | #8 |
creator of calibre
Posts: 43,909
Karma: 22669818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
ebook-convert a.epub b.epub --help | grep chapter
|
04-26-2023, 03:42 AM | #9 |
Whatever...
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
|
--chapter=/
Thank you, that was what I needed, now it works the way I want it! |
|
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 before headings | fabianmoreno01 | Editor | 10 | 01-21-2022 01:32 AM |
Chapter titles and level 1 headings breaking to new page | karennewton1 | Conversion | 1 | 04-26-2016 01:50 PM |
Level 2 headings without page breaks? | RobertDDL | Conversion | 2 | 06-04-2015 06:40 AM |
unnecessary/unwanted page breaks | bgoldnyxnet | ePub | 5 | 02-06-2014 05:56 PM |