Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-16-2019, 06:43 AM   #1
plznot
Junior Member
plznot began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kindle Paperwhite 2018
Unwanted page breaks during OTD to MOBI conversion

When I convert my OTD file to a MOBI file, Calibre automatically inserts a page break on every new header 1 and 2. My problem is that my book is structured somewhat like this
  1. Chapter 1
    1. Chapter 1.1
    2. Chapter 1.2
    3. ...
  2. Chapter 2
    1. Chapter 2.1
    2. Chapter 2.2
    3. ...
  3. Chapter 3
    1. Chapter 3.1
    2. Chapter 3.2
    3. ...
  4. ...

The title of x is always on a its own page with the title of x.1 and its content being on the next page.
I want there to be a page break at the start of a new chapter and a new subchapter, except x.1, without removing x.1 from the index.
How do I accomplish that?
plznot is offline   Reply With Quote
Old 04-16-2019, 08:25 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: 34,223
Karma: 10266832
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look in the structure detection section of the conversion dialog.
kovidgoyal is offline   Reply With Quote
Old 04-16-2019, 11:59 AM   #3
plznot
Junior Member
plznot began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by kovidgoyal View Post
Look in the structure detection section of the conversion dialog.
I've already looked there. But since I have no idea how XPath expressions works and the other options don't help me in any way, it was a dead end for me.

To be more precise, I don't see a way to specify that I don't want it to create a page break on x.1 but do create one on x, x.2, x.3, ...

Last edited by plznot; 04-16-2019 at 12:04 PM.
plznot is offline   Reply With Quote
Old 04-16-2019, 12:47 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 22,925
Karma: 23982162
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by plznot View Post
I've already looked there. But since I have no idea how XPath expressions works and the other options don't help me in any way, it was a dead end for me.

To be more precise, I don't see a way to specify that I don't want it to create a page break on x.1 but do create one on x, x.2, x.3, ...

You just want to reduce the trigger conditions
Since 'Chapter' is in Both, something else must change: That could be making sub chapters H2 and removing that break condition (remember you style using the CSS, not the heading level numbers ( way )
Code:
Structure detection (on the conversion dialog, NOT preferences, which is FUTURE defaults) 

Insert Page breaks
Code:
//*[name()='h1' or name()='h2']
theducks is offline   Reply With Quote
Old 04-16-2019, 01:46 PM   #5
plznot
Junior Member
plznot began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2019
Device: Kindle Paperwhite 2018
Quote:
Originally Posted by theducks View Post
Code:
//*[name()='h1' or name()='h2']
So I would have to manually change 1.1, 2.1, 3.1, ... to h2? I don't object, but I am not sure whether or not it's possible for an ODT document in LibreOffice. (at least I couldn't find how)

Is there a way to to a exclude something from an XPath match?
In Regex I would match
Code:
Chapter \d*(?!.)|Chapter \d*\.(?!1)\d*
and thus exclude the subchapters I don't want to have a page break on.
From what I can see XPath is too limited in features to do that though.
plznot is offline   Reply With Quote
Old 04-16-2019, 05:38 PM   #6
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,738
Karma: 10793146
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@plznot IMO it's best to do as much as possible in LO. If you learn how to use its template and style features you will have less fiddling and editing to do after any conversions, see ==>> Libre Office: Using Styles and Templates.

Using Styles rather than inline styling will also result in much neater code in the conversion output. And, I recommend saving as DOCX and converting that. The DOCX input module does a better job than its ODT equivalent, and its actively maintained by Kovid Goyal (calibre creator/owner).

BR
BetterRed is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre unwanted page breaks ebookscovers Conversion 20 05-03-2017 02:10 PM
MOBI to EPUB conversion in calibre adds page breaks waynn Conversion 15 04-05-2017 03:05 PM
Unwanted page breaks being inserted Phssthpok Conversion 3 01-10-2017 09:14 AM
unnecessary/unwanted page breaks bgoldnyxnet ePub 5 02-06-2014 05:56 PM
HTML to MOBI conversion ignores page breaks LeftHanded Matt Conversion 2 12-21-2011 12:25 PM


All times are GMT -4. The time now is 08:51 PM.


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