Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-24-2023, 08:11 AM   #1
RobertDDL
Whatever...
RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.
 
RobertDDL's Avatar
 
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?
RobertDDL is offline   Reply With Quote
Old 04-24-2023, 09:28 AM   #2
Sarmat89
Evangelist
Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.Sarmat89 ought to be getting tired of karma fortunes by now.
 
Posts: 482
Karma: 2267928
Join Date: Nov 2015
Device: none
You will get page breaks if the text is split between the files.
Sarmat89 is offline   Reply With Quote
Old 04-25-2023, 03:03 AM   #3
RobertDDL
Whatever...
RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.
 
RobertDDL's Avatar
 
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
Quote:
Originally Posted by Sarmat89 View Post
You will get page breaks if the text is split between the files.
Thank you, yes, I understand that, but how do I keep Calibre from splitting the text into separate files whenever it sees a heading level 2 starting with the word "Chapter"?

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?
RobertDDL is offline   Reply With Quote
Old 04-25-2023, 03:06 AM   #4
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,909
Karma: 22669818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look in the structure detection section of the conversion dialog
kovidgoyal is online now   Reply With Quote
Old 04-25-2023, 04:36 AM   #5
RobertDDL
Whatever...
RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.
 
RobertDDL's Avatar
 
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
Quote:
Originally Posted by kovidgoyal View Post
Look in the structure detection section of the conversion dialog
Sorry, what should I look for, and how is this going to help?

<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?
RobertDDL is offline   Reply With Quote
Old 04-25-2023, 04:37 AM   #6
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,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.
kovidgoyal is online now   Reply With Quote
Old 04-25-2023, 08:16 AM   #7
RobertDDL
Whatever...
RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.
 
RobertDDL's Avatar
 
Posts: 197
Karma: 1114225
Join Date: Feb 2015
Location: Austria
Device: PocketBook InkPad 840, Touch HD 2
Quote:
Originally Posted by kovidgoyal View Post
Change the detect chapters expression to / or change the chapter mark to none.
Thank you. Sorry for asking this question, but I could not find the answer in the documentation - how do I do this?

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
RobertDDL is offline   Reply With Quote
Old 04-25-2023, 10:47 AM   #8
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,909
Karma: 22669818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
ebook-convert a.epub b.epub --help | grep chapter
kovidgoyal is online now   Reply With Quote
Old 04-26-2023, 03:42 AM   #9
RobertDDL
Whatever...
RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.RobertDDL ought to be getting tired of karma fortunes by now.
 
RobertDDL's Avatar
 
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!
RobertDDL 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 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


All times are GMT -4. The time now is 01:44 AM.


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