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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-29-2010, 03:28 PM   #1
Fmstrat
G:RSS-Web Creator
Fmstrat began at the beginning.
 
Posts: 91
Karma: 14
Join Date: Aug 2010
Device: Kindle 3, PW, Nexus 4,10
To MOBI, Chapter detection fails? Works for EPUB

I'm running into an odd problem. I have a LIT document, with the following contained within it:

Quote:
<h3 id="_RWTOC-5">Chapter 1</h3><h4 id="_RWTOC-6">Title of this section</h4>
When I run a conversion to EPUB using all the default settings, chapter detection works fine. (Granted, this is surprising to me since the defaults only seem to check h1 and h2 tags, but it works.)

When I try to convert the same file to MOBI, I get a blank TOC. I've tried resetting chapter detection to:

Quote:
//*[((name()='h1' or name()='h2' or name()='h3') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter']
Basically adding h3 tags. Still no luck. Anyone know why this wouldn't be working for me? I've tried converting the EPUB to MOBI as well, with the same results.

Thanks,
B.
Fmstrat is offline   Reply With Quote
Old 08-29-2010, 03:45 PM   #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: 24,817
Karma: 4369673
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
chapter detection happens in the conversion pipeline well before either epub or mobi specific code is invoked. So that's not the issue.

First check: When you say you get a blank TOC in MOBI do you mean an TOC within the book's contents, or the metadata TOC (i.e. the TOC accessed by presisng the menu button on a kindle or the TOC button in the calibre viewer)
kovidgoyal is offline   Reply With Quote
Old 08-29-2010, 04:02 PM   #3
jackie_w
Wizard
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: 2,572
Karma: 3784089
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350/650/T1, PB360, Kobo Glo/AuraHD/Aura6"
Does it make a difference if you try checking the box 'Force use of auto-generated TOC' on the Convert | Table of Contents page?

If your headings are all defined with <h3> tags then a simple //h:h3 should suffice in the 'Detect chapters at' box.
jackie_w is offline   Reply With Quote
Old 08-29-2010, 04:11 PM   #4
Fmstrat
G:RSS-Web Creator
Fmstrat began at the beginning.
 
Posts: 91
Karma: 14
Join Date: Aug 2010
Device: Kindle 3, PW, Nexus 4,10
Wow, thanks for the speedy responses everyone.

Quote:
Originally Posted by kovidgoyal View Post
chapter detection happens in the conversion pipeline well before either epub or mobi specific code is invoked. So that's not the issue.

First check: When you say you get a blank TOC in MOBI do you mean an TOC within the book's contents, or the metadata TOC (i.e. the TOC accessed by presisng the menu button on a kindle or the TOC button in the calibre viewer)
It's blank in Calibre's built in reader when pressing the TOC button as well as in Mobipocket's Desktop reader. I do not currently have a Kindle, but have one on order (thus why I'm converting everything over). So there is a difference between how Calibre and the Kindle use the TOC?

Quote:
Originally Posted by jackie_w View Post
Does it make a difference if you try checking the box 'Force use of auto-generated TOC' on the Convert | Table of Contents page?

If your headings are all defined with <h3> tags then a simple //h:h3 should suffice in the 'Detect chapters at' box.
Neither of these options made a difference for me.

Thanks again,
B.
Fmstrat is offline   Reply With Quote
Old 08-29-2010, 04:14 PM   #5
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: 24,817
Karma: 4369673
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
the next thing to do is post the job log from the mobi conversion, you can get it by clicking the rotating spinner in the bottom right corner.
kovidgoyal is offline   Reply With Quote
Old 08-29-2010, 04:21 PM   #6
Fmstrat
G:RSS-Web Creator
Fmstrat began at the beginning.
 
Posts: 91
Karma: 14
Join Date: Aug 2010
Device: Kindle 3, PW, Nexus 4,10
Quote:
Originally Posted by kovidgoyal View Post
the next thing to do is post the job log from the mobi conversion, you can get it by clicking the rotating spinner in the bottom right corner.
Here it is. Appears to be finding the chapters OK.

Code:
Convert book 1 of 1 (Book)
Resolved conversion options
calibre version: 0.7.16
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2' or name()='h3') and re:test(., 'chapter|book|section|part\\s+', 'i')) or @id = '_RWTOC-5' or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': 'c:\\users\\me\\appdata\\local\\temp\\calibre_0.7.16_tmp_vs6j4d\\calibre_0.7.16_qyio41.jpeg',
 'debug_pipeline': None,
 'disable_font_rescaling': False,
 'dont_compress': False,
 'extra_css': None,
 'font_size_mapping': None,
 'footer_regex': u'(?i)(?<=<hr>)((\\s*<a name=\\d+></a>((<img.+?>)*<br>\\s*)?\\d+<br>\\s*.*?\\s*)|(\\s*<a name=\\d+></a>((<img.+?>)*<br>\\s*)?.*?<br>\\s*\\d+))(?=<br>)',
 'header_regex': u'(?i)(?<=<hr>)((\\s*<a name=\\d+></a>((<img.+?>)*<br>\\s*)?\\d+<br>\\s*.*?\\s*)|(\\s*<a name=\\d+></a>((<img.+?>)*<br>\\s*)?.*?<br>\\s*\\d+))(?=<br>)',
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x050C7B90>,
 'insert_blank_line': False,
 'insert_metadata': False,
 'isbn': None,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'max_toc_links': 50,
 'no_chapters_in_toc': False,
 'no_inline_navbars': False,
 'no_inline_toc': False,
 'output_profile': <calibre.customize.profiles.OutputProfile object at 0x050C7D70>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'personal_doc': u'[PDOC]',
 'prefer_author_sort': False,
 'prefer_metadata_cover': False,
 'preprocess_html': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': 'c:\\users\\me\\appdata\\local\\temp\\calibre_0.7.16_tmp_vs6j4d\\calibre_0.7.16_t5ybsw.opf',
 'remove_first_image': False,
 'remove_footer': False,
 'remove_header': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'rescale_images': False,
 'series': None,
 'series_index': None,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'toc_title': None,
 'use_auto_toc': True,
 'verbose': 2}
InputFormatPlugin: LIT Input running
on C:\Users\me\Calibre Library\Author\Book\Book.lit
Parsing all content...
Parsing Author%20Book.htm ...
Forcing Author%20Book.htm into XHTML namespace
Parsing ~cov0001.htm ...
Forcing ~cov0001.htm into XHTML namespace
Parsing Contents.htm ...
Forcing Contents.htm into XHTML namespace
Parsing index.htm ...
Forcing index.htm into XHTML namespace
Reading TOC from HTML...
Choosing other.ms-coverimage-standard:cover.jpg as the cover
Merging user specified metadata...
Detecting structure...
	Detected chapter: Chapter 1
	Detected chapter: Chapter 2
	Detected chapter: Chapter 3
	Detected chapter: Chapter 4
	Detected chapter: Chapter 5
	Detected chapter: Chapter 6
	Detected chapter: Chapter 7
	Detected chapter: Chapter 8
	Detected chapter: Chapter 9
	Detected chapter: Chapter 10
	Detected chapter: Chapter 11
	Detected chapter: Chapter 12
	Detected chapter: Chapter 13
	Detected chapter: Chapter 14
	Detected chapter: Chapter 15
	Detected chapter: Chapter 16
	Detected chapter: Chapter 17
	Detected chapter: Chapter 18
	Detected chapter: Chapter 19
	Detected chapter: Chapter 20
	Detected chapter: Chapter 21
	Detected chapter: Chapter 22
	Detected chapter: Chapter 23
	Detected chapter: Chapter 24
	Detected chapter: Chapter 25
	Detected chapter: Chapter 26
	Detected chapter: Chapter 27
	Detected chapter: Chapter 28
	Detected chapter: Chapter 29
	Detected chapter: Chapter 30
	Detected chapter: Chapter 31
	Detected chapter: Chapter 32
	Detected chapter: Chapter 33
	Detected chapter: Chapter 34
	Detected chapter: Chapter 35
	Detected chapter: Chapter 36
	Detected chapter: Chapter 37
	Detected chapter: Chapter 38
	Detected chapter: Chapter 39
	Detected chapter: Chapter 40
	Detected chapter: Chapter 41
	Detected chapter: Chapter 42
	Detected chapter: Chapter 43
	Detected chapter: Chapter 44
	Detected chapter: Chapter 45
	Detected chapter: Chapter 46
	Detected chapter: Chapter 47
	Detected chapter: Chapter 48
	Detected chapter: Chapter 49
	Detected chapter: Chapter 50
	Detected chapter: Chapter 51
	Detected chapter: Chapter 52
	Detected chapter: Chapter 53
Auto generated TOC with 53 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt

Cleaning up manifest...
Trimming unused files from manifest...
Parsing stylesheet.css ...
Trimming 'WTitle.jpg' from manifest
Trimming 'PPT.jpg' from manifest
Trimming 'PPC.jpg' from manifest
Trimming 'Thumb.jpg' from manifest
Creating MOBI Output...
Applying case-transforming CSS...
Parsing manglecase.css ...

Rasterizing SVG images...
Converting XHTML to Mobipocket markup...

Serializing markup content...
  Compressing markup content...
Generating flat CTOC ...
  CNCX utilization: 1 record, 0% full
Indexing navPoints ...

Generating INDX ...
Serializing images...
MOBI output written to c:\users\me\appdata\local\temp\calibre_0.7.16_tmp_vs6j4d\calibre_0.7.16_kvv8pk.mobi
Fmstrat is offline   Reply With Quote
Old 08-29-2010, 05:10 PM   #7
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: 24,817
Karma: 4369673
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Interesting, nothing leaps out at me in the log. Can you open a ticket and attach the LIT file, I'll look at it when I have a moment.
kovidgoyal is offline   Reply With Quote
Old 08-29-2010, 05:37 PM   #8
Fmstrat
G:RSS-Web Creator
Fmstrat began at the beginning.
 
Posts: 91
Karma: 14
Join Date: Aug 2010
Device: Kindle 3, PW, Nexus 4,10
Quote:
Originally Posted by kovidgoyal View Post
Interesting, nothing leaps out at me in the log. Can you open a ticket and attach the LIT file, I'll look at it when I have a moment.
Ticket added: http://bugs.calibre-ebook.com/ticket/6661
Fmstrat 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
Epub to Mobi Conversion - Designating Chapter Starts? CAJensen01 ePub 18 09-29-2010 12:46 PM
Help with Chapter detection ubergeeksov Calibre 0 09-02-2010 04:56 AM
Can't convert MOBI to EPUB.. conversion FAILS wallace.webmail Calibre 5 07-16-2010 12:45 AM
Mobi (no DRM) fails to convert to epub richmgray Calibre 1 04-11-2010 07:11 PM
chapter detection in any book yuki86 Calibre 9 05-06-2009 06:54 AM


All times are GMT -4. The time now is 12:05 PM.


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