MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Calibre (https://www.mobileread.com/forums/forumdisplay.php?f=166)
-   -   Epub conversion adds page break after chapter headings (https://www.mobileread.com/forums/showthread.php?t=262293)

Siavahda 06-29-2015 06:39 AM

Epub conversion adds page break after chapter headings
 
Literally what it says on the tin; I'm trying to convert an .epub file (into another .epub file, if that's relevant) but each time I do, Calibre inserts a page break between the chapter heading and the chapter title.

I have tried leaving the 'Detect chapters t (XPath expression) box completely blank, chapter mark: none, and 'Insert page breaks before (XPath expression): /, as well as all three in tandem. In each case my chapter files get split in two, one with the chapter heading and the other with the chapter title and main body of the chapter.

There is an image between the chapter heading and chapter title, if that means anything.

Can anyone help, please?

krbo 06-29-2015 07:38 AM

read this thread (my question and kovid's answers):

https://www.mobileread.com/forums/sho...d.php?t=261335

maybe it will give you more ideas where to look

Siavahda 06-29-2015 12:30 PM

Thank you, but that didn't help.

I tried changing the h2 tags of the chapter titles into p tags, but that hasn't helped either.

gbm 06-29-2015 12:51 PM

Quote:

Originally Posted by Siavahda (Post 3125331)
Literally what it says on the tin; I'm trying to convert an .epub file (into another .epub file, if that's relevant) but each time I do, Calibre inserts a page break between the chapter heading and the chapter title.

I have tried leaving the 'Detect chapters t (XPath expression) box completely blank, chapter mark: none, and 'Insert page breaks before (XPath expression): /, as well as all three in tandem. In each case my chapter files get split in two, one with the chapter heading and the other with the chapter title and main body of the chapter.

There is an image between the chapter heading and chapter title, if that means anything.

Can anyone help, please?

The image is your problem, check the css and image size.

bernie

Siavahda 06-29-2015 01:19 PM

Quote:

Originally Posted by gbm (Post 3125513)
The image is your problem, check the css and image size.

bernie

I don't know what I'm looking for? The css looks like this

<p class="centerImage"><img src="../images/00002.jpeg" alt="image" class="epubimage"/></p>

and the image size is 4.6 KB; height 110px, width 118px.

gbm 06-29-2015 01:57 PM

Quote:

Originally Posted by Siavahda (Post 3125523)
I don't know what I'm looking for? The css looks like this

<p class="centerImage"><img src="../images/00002.jpeg" alt="image" class="epubimage"/></p>

and the image size is 4.6 KB; height 110px, width 118px.

That is your html, your css will be in the *.css file, the one you are looking for will be .epubimage and .centerImage.

This is an example of an image css
Code:

.calibre2 {
  height: auto;
  max-height: 100%;
  width: auto;
  max-width: 100%;
}

Post the css for .epubimage and .centerImage.
bernie

theducks 06-29-2015 02:00 PM

Quote:

Originally Posted by Siavahda (Post 3125523)
I don't know what I'm looking for? The css looks like this

<p class="centerImage"><img src="../images/00002.jpeg" alt="image" class="epubimage"/></p>

and the image size is 4.6 KB; height 110px, width 118px.

That is not CSS, that is the html

In the linked CSS (near the top of the code) needed if there is more than 1 CSS file (very legal).

the style info for .centerImage and .epubimage

:chinscratch: I suspect the second sets the size
and the first sets center and margins

Siavahda 06-29-2015 05:22 PM

I found a page-break-before: always in the chapter title css, not the image, so I've fixed that. Will comment once Calibre finishes converting the file (it's huge, it's been at it for hours already) to see if that was the problem.

theducks 06-29-2015 06:44 PM

Quote:

Originally Posted by Siavahda (Post 3125608)
I found a page-break-before: always in the chapter title css, not the image, so I've fixed that. Will comment once Calibre finishes converting the file (it's huge, it's been at it for hours already) to see if that was the problem.

:bulb2: Edit the file (CSS in this case). No need to convert to the same format

Siavahda 06-30-2015 01:10 AM

That WAS the problem. (I had to convert for other reasons, it's fine). Thanks for the help, everyone!


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

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.