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 07-31-2011, 10:53 PM   #1
wannabee
Media Bloke
wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.
 
Posts: 2,377
Karma: 113956855
Join Date: Sep 2010
Location: NSW - Australia
Device: iOS
epub to mobi h1 page breaks not starting on new page

I've converted 10 books from ePub to Mobi. I have a new html file for each chapter and after converting to mobi chapters start on a new page. TOC are all OK.

My last attempt doesn't. Chapters start anywhere. I had a quick look at the tutorial which has some Xpath which I used in the STRUCTURE DETECTION area.

//*[name()='h1' or name()='h2']

What information do you need from me to determine what has changed?

Here's a sample of a file with h1 and h2 headers
Spoiler:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>How NOT to kill your husband.xhtml</title>
<link rel="stylesheet" href="../Styles/template.css" type="text/css" />
<style type="text/css">
/*<![CDATA[*/
p.sgc-2 {font-style: italic}
p.sgc-1 {font-weight: bold}
/*]]>*/
</style>
</head>

<body>
<div class="generated-style" id="how-not-to-kill-your-husband">
<p class="body-txt" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-us"></p>

<h1 id="heading_id_8">2. The Premenstrual Syndrome</h1>

<p class="body-txt" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-us">Katrina had married at the age of 19 against the advice of parents and friends. By the age of 22, she had two beautiful toddlers and a successful husband, who doted on his children. Katrina should have been blissfully happy, but she wasn’t. For two weeks before her periods, she became morose, irritable and hurtful to her family. She lost interest in sex and felt ugly and unloved.</p>

<h2 id="heading_id_9">Common Symptoms of the Premenstrual Syndrome</h2>

<p class="h3" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en">Mental and Psychological Symptoms</p>

<p class="body-txt" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en">Mental and emotional symptoms can include:</p>

<h2 id="heading_id_10">What causes the Premenstrual Syndrome?</h2>

<p class="body-txt" xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en-us">I well remember one evening in the country town of Grafton, NSW, relating Hippocrates theory on the causation of female hormonal imbalances to an entirely male audience. These men had come to listen to my after dinner talk about <span class="italics">How to be a perfect husband</span>. My mother had got me into this rather sticky situation, as she had delighted in ‘setting me up’ when the male dominated Lions Club had requested my services as an after dinner speaker.</p>



ETC. ETC. ETC
wannabee is offline   Reply With Quote
Old 08-01-2011, 10:32 AM   #2
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
The fact that it split the chapters in seemingly arbitrary places indicates that the xpath didn't work - when that happens the book is split ever 270K.

The example text you show should work fine with the xpath above, but by your wording I get the sense that the example text is not from the book which was exhibiting problems. My guess is the book with problems doesn't use h1/h2.

You read the manual already, but this tutorial might help:
http://www.mobileread.com/forums/sho...d.php?t=129364
ldolse is offline   Reply With Quote
 
Enthusiast
Old 08-01-2011, 08:29 PM   #3
wannabee
Media Bloke
wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.
 
Posts: 2,377
Karma: 113956855
Join Date: Sep 2010
Location: NSW - Australia
Device: iOS
Question

Thanks Idolse

The code I posted above is displayed here in the Kindle Previewer. The first h1 of the file is displayed. It displays on a new page in the ePub but not on any of the Kindle Device previews.
I read your tutorial yesterday in order to solve the issue. That's how I found the xPath I posted. Only when it didn't work I decided to ask for help.
I don't know why it would work 10 times and break on the 11th.
Attached Thumbnails
Click image for larger version

Name:	preview.jpg
Views:	99
Size:	302.6 KB
ID:	75050  
wannabee is offline   Reply With Quote
Old 08-01-2011, 09:36 PM   #4
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
The screenshot you're posting is very different from the example code. I see the tic marks are there - do these navigate between the correct chapter points?

If that screenshot is from the original ePub then I can only think of a couple explanations. One is that for some reason you converted to htmlz first, and then for some reason had 'do not split on page breaks' enabled for the conversion to mobi.

The other is that perhaps your css has a page-break-before:avoid style attached to '<div class="generated-style" id="how-not-to-kill-your-husband">' - I'm not sure what Calibre would do in that instance, but it's possible it wouldn't insert the mobipocket page break marker. Check the css in the original ePub.

If neither of the above is true then maybe there is some bug associated with this ebook, open a bug on the bugtracker - https://bugs.launchpad.net/calibre
ldolse is offline   Reply With Quote
Old 08-02-2011, 12:46 AM   #5
wannabee
Media Bloke
wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.wannabee ought to be getting tired of karma fortunes by now.
 
Posts: 2,377
Karma: 113956855
Join Date: Sep 2010
Location: NSW - Australia
Device: iOS
oh dear

Egg on face -

I had been trying to fix up some tables so they displayed in Kindle Previewer and I created a separate InDesign file for mobi in addition to the one I used for the ePub. (This one had the tables reformatted as text) Well, I was viewing the output from the "Export for Kindle" plug-in in inDesign. Not the Calibre converted version.

So I'll just back out the door here and thank you for your help and sorry for wasting your time.
wannabee 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
Page breaks in Mobi files HarryT Kindle Formats 4 02-24-2012 04:43 AM
Ebook not starting at "first" page after converting from epub to mobi bfollowell Conversion 7 08-01-2011 12:52 PM
epub to mobi loses page breaks stevent10993 Conversion 5 07-20-2011 12:43 AM
Mobi page breaks in Calibre viewer DaleDe Calibre 3 04-04-2011 01:58 AM
PDF to EPUB - page breaks pops1959 Calibre 0 01-13-2011 07:28 PM


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


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