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 07-05-2011, 04:49 PM   #1
cjallan
Enthusiast
cjallan doesn't littercjallan doesn't litter
 
cjallan's Avatar
 
Posts: 31
Karma: 130
Join Date: Apr 2010
Location: USA
Device: Kindle 2
Problem with Page Breaks and Structure Detection

At default, Calibre creates a page break before Heading 1, and ALSO before Heading 2.

A page break before Heading 1 is fine, but I don't want a page break before Heading 2.

Someone told me to disable H2 in Structure Detection.

That does disable the page break before Heading 2, but it also removes Heading 2 from the NCX, which I need.

Can someone tell me the proper way to disable the page break before Heading 2?

Thanks very much.

CJ
cjallan is offline   Reply With Quote
Old 07-06-2011, 11:06 PM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Try these conversion settings:

In Convert - StructureDetection
Detect chapters at: //h:h2
Chapter mark: none
Insert pagebreaks before: //h:h1

and in Convert - TOC
Level 1: //h:h1
Level 2: //h:h2
jackie_w is offline   Reply With Quote
Old 07-07-2011, 12:12 PM   #3
cjallan
Enthusiast
cjallan doesn't littercjallan doesn't litter
 
cjallan's Avatar
 
Posts: 31
Karma: 130
Join Date: Apr 2010
Location: USA
Device: Kindle 2
Thanks very much, jackie_w... I followed your instructions...

But... it didn't do the job.

Heading 2 still does not appear in the NCX file... nor in the Table of Contents.

I have a proper Table of Contents, with Headings 1 and Heading 2, as I want them, at the beginning of my file, but I can't make Calibre use it.

The way I read the Calibre instructions, I understand that Calibre will use my own "user generated" TOC to make the NCX file, if "Force TOC" and/or "Structure detection" are not used, but I can't make it happen.

Do you know how I can do that... make Calibre use my own TOC to create the NCX?

Thanks very much for your help!

CJ
cjallan is offline   Reply With Quote
Old 07-07-2011, 01:15 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
I wonder whether your understanding of what 'your own TOC' means may be the problem.

I think 'your own TOC' means that if your source document already contains a toc.ncx file (known as an external TOC) it will use it, if "Force TOC" and/or "Structure detection" are not used. epub, mobi and lit (and maybe others) often contain a working toc.ncx.

I'm not sure whether a page at the front of the book containing some hyperlinks to other pages (known as an inline TOC) will convert to a fully working toc.ncx.

I never use inline TOCs myself so perhaps I'm not the best person to answer your question.

What format is your source document?
jackie_w is offline   Reply With Quote
Old 07-07-2011, 08:33 PM   #5
cjallan
Enthusiast
cjallan doesn't littercjallan doesn't litter
 
cjallan's Avatar
 
Posts: 31
Karma: 130
Join Date: Apr 2010
Location: USA
Device: Kindle 2
My source document is a MS Word 2003 Doc file, with a table of contents built with Word's TOC wizard.

I could build a hyperlinked table of contents instead of the Word wizard TOC if that would help.
cjallan is offline   Reply With Quote
Old 07-07-2011, 10:12 PM   #6
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Did you save the book as Webpage-filtered before importing to Calibre or did you save it as RTF?

Also, in the .doc file, did you style your chapter headings with the built-in 'Heading 1' and 'Heading 2' styles?

As I said previously, I don't know whether Calibre does anything with hyperlink TOCs. Someone else may chip in with an answer. However if you've used the correct Word heading styles, Calibre should be able to use those to create the toc.ncx file.

Last edited by jackie_w; 07-07-2011 at 10:15 PM.
jackie_w is offline   Reply With Quote
Old 07-08-2011, 03:43 AM   #7
cjallan
Enthusiast
cjallan doesn't littercjallan doesn't litter
 
cjallan's Avatar
 
Posts: 31
Karma: 130
Join Date: Apr 2010
Location: USA
Device: Kindle 2
Yes, I use MS Word's built-in chapter heading Styles, Heading 1 and Heading 2 and create the Table of Contents with MS Word's Table of Contents Wizard.

Then I save my Word file as "Web Page, Filtered", and import that HTML file into Calibre.

Calibre appears to be using my Table of Contents to build the Table of Contents that it puts in the end of the mobi file.

The reason I think that is, that if I don't add a Table of Contents to the front of my file, Calibre won't add one to the end of the file.
cjallan is offline   Reply With Quote
Old 07-08-2011, 08:12 AM   #8
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
I believe that Calibre is using the <h1> and <h2> tags in the html file to create your end-of-mobi TOC, not your hyperlink TOC. However, I stand to be corrected as I'm not a mobi user.

The <h1> tags in the html file are automatically created from the Word 'Heading 1' styles and <h2> tags from 'Heading 2' etc.

I'm attaching a small sample Word doc containing 'Heading 1' and 'Heading 2' titles. I have not created any inline hyperlink TOC.

I then saved it as Webpage-filtered, imported to Calibre and did a zip-to-mobi conversion using the settings I listed above in post #2. As far as I can see, in Kindle-for-PC, the mobi is doing what you asked, i.e. a pagebreak for every H1 but not for H2s. The 2-level TOC also looks correct.

I've attached the mobi. Am I not understanding something fundamental?
Attached Files
File Type: doc mobitest.doc (23.0 KB, 160 views)
File Type: mobi mobitest.mobi (11.0 KB, 148 views)
jackie_w is offline   Reply With Quote
Old 07-08-2011, 11:34 AM   #9
cjallan
Enthusiast
cjallan doesn't littercjallan doesn't litter
 
cjallan's Avatar
 
Posts: 31
Karma: 130
Join Date: Apr 2010
Location: USA
Device: Kindle 2
Quote:
Originally Posted by jackie_w View Post
I believe that Calibre is using the <h1> and <h2> tags in the html file to create your end-of-mobi TOC, not your hyperlink TOC. However, I stand to be corrected as I'm not a mobi user.

The <h1> tags in the html file are automatically created from the Word 'Heading 1' styles and <h2> tags from 'Heading 2' etc.

I'm attaching a small sample Word doc containing 'Heading 1' and 'Heading 2' titles. I have not created any inline hyperlink TOC.

I then saved it as Webpage-filtered, imported to Calibre and did a zip-to-mobi conversion using the settings I listed above in post #2. As far as I can see, in Kindle-for-PC, the mobi is doing what you asked, i.e. a pagebreak for every H1 but not for H2s. The 2-level TOC also looks correct.

I've attached the mobi. Am I not understanding something fundamental?
Maybe a "bingo"... there...

I am not doing a "zip-to-mobi"... nor have I ever seen such a reference.

So maybe that is what I am missing.

I will look for that, then, I will look closely at your samples.

Thanks very much... it will be a few hours before I can get back on it, but I will go through these steps and come back to report my progress.

Thanks again,

CJ
cjallan is offline   Reply With Quote
Old 07-09-2011, 12:49 AM   #10
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by cjallan View Post
I am not doing a "zip-to-mobi"... nor have I ever seen such a reference.

So maybe that is what I am missing.

I will look for that, then, I will look closely at your samples.
When you add a HTML file to Calibre it is normally stored as a ZIP file. When you have such a file then ZIP is offered as a selection for the input format on the book in question when you select it for conversion.
itimpi is offline   Reply With Quote
Old 07-10-2011, 06:04 PM   #11
cjallan
Enthusiast
cjallan doesn't littercjallan doesn't litter
 
cjallan's Avatar
 
Posts: 31
Karma: 130
Join Date: Apr 2010
Location: USA
Device: Kindle 2
Quote:
Originally Posted by jackie_w View Post
I believe that Calibre is using the <h1> and <h2> tags in the html file to create your end-of-mobi TOC, not your hyperlink TOC. However, I stand to be corrected as I'm not a mobi user.

The <h1> tags in the html file are automatically created from the Word 'Heading 1' styles and <h2> tags from 'Heading 2' etc.

I'm attaching a small sample Word doc containing 'Heading 1' and 'Heading 2' titles. I have not created any inline hyperlink TOC.

I then saved it as Webpage-filtered, imported to Calibre and did a zip-to-mobi conversion using the settings I listed above in post #2. As far as I can see, in Kindle-for-PC, the mobi is doing what you asked, i.e. a pagebreak for every H1 but not for H2s. The 2-level TOC also looks correct.

I've attached the mobi. Am I not understanding something fundamental?

I looked at your Mobi file with the desktop Kindle Previewer:

It illustrates exactly what I've been trying to describe.

The TOC does, indeed, display 2 levels... H1 and H2.

BUT... the NCX view displays only 1 level... H2.

It does not display H1, it just ignores H1.

That has been my luck:

The TOC is just fine, it displays H1 and H2, but I can't make the NCX view display properly.

I can display H1 or H2, in the NCX view, but not both.

Thanks very much!

CJ
cjallan is offline   Reply With Quote
Old 07-10-2011, 06:13 PM   #12
cjallan
Enthusiast
cjallan doesn't littercjallan doesn't litter
 
cjallan's Avatar
 
Posts: 31
Karma: 130
Join Date: Apr 2010
Location: USA
Device: Kindle 2
Quote:
Originally Posted by itimpi View Post
When you add a HTML file to Calibre it is normally stored as a ZIP file. When you have such a file then ZIP is offered as a selection for the input format on the book in question when you select it for conversion.
Thanks, Itimpi.

I guess I was doing it right, then.

I am taking great care to follow instructions correctly, but still cannot make the NCX file display correctly.

Any thoughts as to what might be wrong?

Thanks for your input,

CJ
cjallan is offline   Reply With Quote
Old 07-10-2011, 07:30 PM   #13
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 NCX is probably being built with the Chapter detection xpath vs. the multi-level TOC xpath.

Try putting this in 'detect chapters' under structure detection ( still following the rest of jackie_w's instructions):
Code:
//*[name()='h1' or name()='h2']
Can't tell exactly what you're trying to do based on your descriptions though...
If you're trying to force Calibre to use your original inline TOC then you need to convert to ePub first, and follow the guidelines in this post:
https://www.mobileread.com/forums/sho...0&postcount=11

Note if you follow that post you then probably also need to go under the mobi output options and enable the 'Do not add Table of Contents to book' option.

Last edited by ldolse; 07-10-2011 at 07:40 PM.
ldolse is offline   Reply With Quote
Old 07-10-2011, 08:37 PM   #14
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by cjallan View Post
I looked at your Mobi file with the desktop Kindle Previewer:
It illustrates exactly what I've been trying to describe.
The TOC does, indeed, display 2 levels... H1 and H2.
BUT... the NCX view displays only 1 level... H2.
It does not display H1, it just ignores H1.
What is the NCX view? I just used Goto TOC in Kindle-for-PC plus I opened the mobi in the Calibre Viewer. Both of these seemed to be OK. Is NCX view something else? I don't have a Kindle so I'm not familiar with the finer details.
jackie_w is offline   Reply With Quote
Old 07-10-2011, 09:28 PM   #15
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
Quote:
Originally Posted by jackie_w View Post
What is the NCX view? I just used Goto TOC in Kindle-for-PC plus I opened the mobi in the Calibre Viewer. Both of these seemed to be OK. Is NCX view something else? I don't have a Kindle so I'm not familiar with the finer details.
Not to put words in the OPs mouth, but I can only assume he's referring to the tic marks at the bottom of the Kindle - you can see these if you load the mobi file into the Kindle previewer app (kindle for PC/Mac won't work). These also tie into the chapter skipping function with the 5 way controller. I don't know of any other use of the NCX file in mobi.

Last edited by ldolse; 07-10-2011 at 09:33 PM.
ldolse is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RTF conversion problem - no page breaks jhsrennie Conversion 7 06-16-2011 01:29 PM
Structure Detection Problems Jonnster Conversion 21 05-12-2011 02:12 PM
structure detection - documentation ? cybmole Calibre 27 01-12-2011 02:14 AM
Problem with --page-breaks-before pepak Calibre 5 10-24-2009 04:50 PM
Structure detection v5.5 and v6.2 AlexBell Calibre 2 07-29-2009 10:11 PM


All times are GMT -4. The time now is 08:59 AM.


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