MOBI: No Table of Contents

Bug #747870 reported by David Troutman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Won't Fix
Undecided
Unassigned

Bug Description

I download fanfics using FanfictionLoader, and I've found this to be a consistent problem:

If I download as MOBI, (eg: http://www.mediafire.com/?1fh3d38t0zqhd5l ) W/O CONVERTING IN CALIBRE, THE INCL. TOC WORKS.

If I convert from MOBI to MOBI (to create chapter markers), THE INCLUDED TOC IS NOT DETECTED.

If I convert from MOBI to EPUB to MOBI, THE INCLUDED TOC IS NOT DETECTED.

If I convert from MOBI to EPUB, edit in Sigil and rename the .html file on which the TOC is located, then convert from EPUB to MOBI, THE TOC WORKS.

I'm not sure what the problem is, but it would seem that merely renaming the TOC's file (via EPUB) fixes the problem. I've even confirmed this by editing the EPUB and re-renaming the file back to it's original name to find that converting to MOBI breaks the TOC again.

Here is a log of MOBI to MOBI which broke the included TOC:

Convert book 1 of 1 (Creature of Habit)
Resolved conversion options
calibre version: 0.7.52
{'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|prologue|epilogue\\s+', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': None,
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'dont_compress': False,
 'enable_heuristics': False,
 'extra_css': None,
 'fix_indents': True,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x059AABF0>,
 'insert_blank_line': True,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': True,
 'language': None,
 'level1_toc': u"//*[name()='h1']",
 'level2_toc': u"//*[name()='h2']",
 'level3_toc': u"//*[name()='h3']",
 'line_height': 0.0,
 'linearize_tables': True,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markup_chapter_headings': True,
 'max_toc_links': 0,
 'minimum_line_height': 120.0,
 'mobi_ignore_margins': False,
 'no_chapters_in_toc': True,
 'no_inline_navbars': True,
 'no_inline_toc': True,
 'output_profile': <calibre.customize.profiles.KindleOutput object at 0x059AAF10>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2' or name()='h3']",
 'personal_doc': u'[PDOC]',
 'prefer_author_sort': False,
 'prefer_metadata_cover': False,
 'pretty_print': False,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': 'c:\\users\\david\\appdata\\local\\temp\\calibre_0.7.52_tmp_erwfjq\\calibre_0.7.52_c0i9ou.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': True,
 'remove_paragraph_spacing_indent_size': 1.5,
 'renumber_headings': True,
 'replace_scene_breaks': u'',
 'rescale_images': False,
 'series': None,
 'series_index': None,
 'smarten_punctuation': True,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'toc_title': None,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
InputFormatPlugin: MOBI Input running
on C:\Users\Public\Dropbox\Public\eBook_Library\EZRocksAngel\Creature of Habit (435)\Creature of Habit - EZRocksAngel.azw
Extracting text...
Adding anchors...
Extracting images...
Cleaning up HTML...
Parsing HTML...
Converting style information to CSS...
Creating OPF...
Parsing all content...
Parsing styles.css ...
Parsing Creature%20of%20Habit.html ...
Forcing Creature%20of%20Habit.html into XHTML namespace
Guide reference 'Creature of Habit.html#filepos1147' not found
Reading TOC from NCX...
Merging user specified metadata...
Detecting structure...
 Detected chapter: 1. Chapter 1
 Detected chapter: 2. Chapter 2
 Detected chapter: 3. Chapter 3
 Detected chapter: 4. Chapter 4
 Detected chapter: 5. Chapter 5
 Detected chapter: 6. Chapter 6
 Detected chapter: 7. Chapter 7
 Detected chapter: 8. Chapter 8
 Detected chapter: 9. Chapter 9
 Detected chapter: 10. Chapter 10
 Detected chapter: 11. Chapter 11
 Detected chapter: 12. Chapter 12
 Detected chapter: 13. Chapter 13
 Detected chapter: 14. Chapter 14
 Detected chapter: 15. Chapter 15
 Detected chapter: 16. Chapter 16
 Detected chapter: 17. Chapter 17
 Detected chapter: 18. Chapter 18
 Detected chapter: 19. Chapter 19
 Detected chapter: 20. Chapter 20
 Detected chapter: 21. Chapter 21
 Detected chapter: 22. Chapter 22
 Detected chapter: 23. Chapter 23
 Detected chapter: 24. Chapter 24
 Detected chapter: 25. Chapter 25
 Detected chapter: 26. Chapter 26
 Detected chapter: 27. Chapter 27
 Detected chapter: 28. Chapter 28
 Detected chapter: 29. Chapter 29
 Detected chapter: 30. Chapter 30
 Detected chapter: 32. Chapter 32
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Parsing stylesheet.css ...
Found 66 items of level: div_1
Found 63 items of level: div_2
Found 4960 items of level: p_3
Found 1 items of level: p_1
Ignoring level p_1
div_1 left margin stats: Counter({u'': 32})
div_1 right margin stats: Counter({u'': 32})
div_2 left margin stats: Counter({u'': 32})
div_2 right margin stats: Counter({u'': 32})
p_3 left margin stats: Counter({u'0': 4960})
p_3 right margin stats: Counter({u'0': 4960})
Cleaning up manifest...
Trimming unused files 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\david\appdata\local\temp\calibre_0.7.52_tmp_erwfjq\calibre_0.7.52__knjwo.mobi

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 747870

Attach a file demonstrating/reproducing the problem. And when you do, please leave a comment as I am not notified for attachments.

And dont type in capitals, it's rude.

 status incomplete

Changed in calibre:
status: New → Incomplete
Revision history for this message
Kovid Goyal (kovid) wrote :
  • t.mobi Edit (645.5 KiB, application/octet-stream)

Never mind, I see you posted a link to the file. I converted it to MOBI in calibre and the TOC was created perfectly. See attachment.

Changed in calibre:
status: Incomplete → Invalid
Revision history for this message
David Troutman (chyron8472) wrote :

No, that's not the problem.

Calibre can create its own TOC at the end of the book. That is true. What I want is for Calibre to convert to a mobi that detects the already included TOC at the /beginning/ of the book as the TOC, such that when the Kindle navgates to the TOC, it navigates to the one at the beginning.

So, what happens is that the ebook in question (and others like it) download with a working TOC at the start of the ebook that the Kindle (or Kindle Previewer) will navigate directly to.

When I convert the mobi to mobi in Calibre, with "Do not add TOC to book" selected in the mobi output settings (as I do not need it), the once-working TOC at the /start/ of the book does not work in that the Goto... -> TOC link on the Kindle is grey.

If I convert from mobi to mobi it happens, as well as mobi to epub to mobi.

If I convert from mobi to epub, rename the html page where the TOC is at the start of the book, then convert from epub to to mobi, the TOC will work.

Here is the original file: http://www.mediafire.com/?1fh3d38t0zqhd5l

Here is the mobi to mobi converted file with broken TOC at start of book: http://www.mediafire.com/?449gwhus62gaqph
Screenshot example of problem: http://i.imgur.com/sPO3S.png

Here is mobi to epub converted file which, when embedded TOC file is called "Creature of Habit_split_001.html" converting to mobi breaks TOC at start of book, yet when renaming file (eg. "1.html") TOC at start of book works: http://www.mediafire.com/?hrz9axy293rm9ky
Screenshot of required manual workaround: http://i.imgur.com/Lccta.png
Note: "Table of Contents" is selected from "semantics" right-click drop menu in Sigil before converting back to mobi but does not fix this.

Here is the working file converted to mobi after the TOC's filename has been changed manually while epub: http://www.mediafire.com/?hrz9axy293rm9ky
Screenshot of desired output: http://i.imgur.com/IvQPL.png

Note that in the desired ouput mobi file, the Table of Contents button in Kindle Previewer (and by extension the Goto -> Table of Contents link on the Kindle) links to the TOC at the front of the book which was included with the original book itself and not a TOC at the back which would have been created by Calibre.

Revision history for this message
David Troutman (chyron8472) wrote :

[quote]Here is the working file converted to mobi after the TOC's filename has been changed manually while epub: http://www.mediafire.com/?hrz9axy293rm9ky[/quote]

That is the wrong link. here is the right one: http://www.mediafire.com/?i0rfkqf5ypfrd2d

Changed in calibre:
status: Invalid → In Progress
status: In Progress → Incomplete
Revision history for this message
Kovid Goyal (kovid) wrote :

There is no way to do that in calibre.

 status wontfix

Revision history for this message
David Troutman (chyron8472) wrote :

Suffice it to say that I want to convert from directly from mobi to mobi and keep pointing to the TOC at the front of the book.

The steps involving epub are included to show the only required workaround I am currently aware of.

Kovid Goyal (kovid)
Changed in calibre:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.