![]() |
#16 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
Quote:
Also, I suspect when you removed duplicates in Sigil you may have removed the wrong ones. For instance, if you select Chap 5 you now go to the line 'Chapter 5: The Cave of Trees' instead of the image at the top of the page. i.e. the TOC is no longer pointing at the "invisible" <h2> chapter heading at the top of the page but at the "visible" styling <h2> lower down instead. Of course, if you like it better the way it is feel free to ignore my comments ![]() Quote:
It should be easy enough to remove it manually. You need to edit the file called content.opf inside the epub (Tweak-epub in Calibre will let you do it). The bare minimum you need is to go to the spine section and remove the line marked in red below: Code:
<spine toc="ncx">
<itemref idref="filelist.xml"/>
<itemref idref="titlepage.xhtml"/>
The file called filelist.xml was contained in your original HTML zip file and I suspect is one of those MS excess baggage files you get when you don't save Word as webpage-filtered. It probably would have been safe to remove it before importing to Calibre for the initial epub conversion. Calibre knows about the file but seems to sensibly exclude it from the epub spine. It would appear that Sigil doesn't ignore it. You could ask for help in the Sigil forum. |
|||
![]() |
![]() |
![]() |
#17 | ||||||
Enthusiast
![]() Posts: 31
Karma: 10
Join Date: Oct 2010
Location: Arizona, USA
Device: None
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
![]() I will come back to this in the morning, perhaps with a more fresh and insightful perspective. Again, I can't say enough, thank you, Jackie! |
||||||
![]() |
![]() |
![]() |
#18 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Hi webfolk,
If you prefer the 2-level TOC (see attached image below), i.e. Parts and Chapters at same level in TOC with Sections still nested under Chapters, then there is a simple solution not involving Sigil. Import your cleaned up HTML (blank lines removed etc) into Calibre and convert to EPUB using the settings detailed in post #9 step 2, with the following minor changes: Code:
Table of Contents - Level 1 TOC - //*[@class="invisible"] Table of Contents - Level 2 TOC - //h:h3 Table of Contents - Level 3 TOC - leave empty |
![]() |
![]() |
![]() |
#19 |
Enthusiast
![]() Posts: 31
Karma: 10
Join Date: Oct 2010
Location: Arizona, USA
Device: None
|
This looks very good, Jackie! I like the way the table of contents looks ... it really does it! I'll get to work on this. If you don't hear from me for awhile, know that I'm busy "having fun".
![]() Last edited by webfolk; 11-02-2010 at 12:40 PM. |
![]() |
![]() |
![]() |
#20 | ||
Enthusiast
![]() Posts: 31
Karma: 10
Join Date: Oct 2010
Location: Arizona, USA
Device: None
|
Hi Jackie. Here's what's been happening. I've done all of the following, starting with the ZIP file you attached in Post 9:
Quote:
Quote:
I posted a query on a Kompozer forum and got several suggestions that didn't work and one that shows promise. Here it is: The examples you cite are characteristic of character encoding issues. You can change the character encoding on the format>page title and properties window (in Kompozer). Select the character encoding to match your original document. If you look at the html file in a text editor there should be a line in the head section similar to: However, I'm having a problem viewing the HTML file in the resident Mac text editor, TextEdit (all that can be seen are the illustrations on black background with no visible text) so I'm at an impasse.Code: Select all <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> You would be interested in the charset= part and see if it is in the KompoZer list. Do you know what the character encoding is? Is it derived from the original source file in Word or does Calibre alter it? Do you have any other insight or approach? One possibility is to avoid working in HTML and convert the Post 9 Zip to EPUB using the parameters you stated in Posts 9 & 18, then do the cleanup in Sigil ... which is the way I created the EPUB attached in Post 15. I share your preference to avoid Sigil, but the only known glitch was the blank page inserted before the book cover, which you resolved. I do hope these complications aren't vexing to you. |
||
![]() |
![]() |
![]() |
#21 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Oh dear...
Firstly, let me say I am definitely not vexed ![]() Unfortunately I'm struggling with my zero-knowledge of Macs and anything to do with Kompozer. However, I'm pretty sure the suggestion about 'encoding problem' is correct. Sadly, my understanding of encoding is also fairly sketchy. I had a look at the original HTML you supplied. The first line is Code:
<?xml version='1.0' encoding='utf-8'?> I believe that when you drag a raw HTML file into Calibre it zips it up and converts the encoding to UTF-8 from whichever encoding it currently is. Calibre tries to figure out the source encoding. I'm not sure what happens if you drag in pre-zipped HTML. When I looked more closely at your original HTML in a text editor, I also noticed that the line-endings are Unix-style, i.e. LF only. My editor tells me that Mac-style should be CR only. So, clutching at straws, I've edited the raw HTML to have Mac-style. I've also changed the encoding so the editor just says UTF-8 and, belt & braces, I've added an extra line 4 Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> I've dragged it into Calibre and it still converts to EPUB OK on my Windows PC. The attached ZIP contains the raw HTML plus the images. Everything else (including the rogue filelist.xml) has been removed. It is pre-Calibre. Try opening this HTML in your text editor. It obviously still needs your edits. I have to say that this statement: Code:
...However, I'm having a problem viewing the HTML file in the resident Mac text editor, TextEdit (all that can be seen are the illustrations on black background with no visible text) so I'm at an impasse... ![]() |
![]() |
![]() |
![]() |
#22 | |||
Enthusiast
![]() Posts: 31
Karma: 10
Join Date: Oct 2010
Location: Arizona, USA
Device: None
|
I'm relieved ... and thanks for saying this right up front!
The following is utterly irrelevant: Quote:
I immediately expanded and tried to open the ZIP you attached in TextEdit and the same thing happened: images only, black background, no visible text. Playing with it in different ways went nowhere. I strongly feel this is a Mac problem and was about to call Apple when I was interrupted by some incoming phone calls. Later, after having let it go for awhile, the thought came to just go ahead and open the HTML in Kompozer and--voila!--it worked. The first thing I did in Kompozer was make a minor change, save the file, then open it in my browser and all the punctuation anomalies were gone. So I went on to make all the changes, import it into Calibre and convert it to an EPUB with all the settings you recommended. And it looks just fine. The last thing is to implement step 3 of post 9 Quote:
Quote:
The rest of your reply, about encoding, is a bit over my head at its present elevation and, quite frankly, I'm willing to put understanding on the back burner for a time, being a bit head-weary. That it works, however, is invigorating! What I do understand (after a quick Google) is "belts and braces." Never heard it before ... really like it! |
|||
![]() |
![]() |
![]() |
#23 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
The current problem is that, in the Viewer, each TOC "Part" is pointing to the wrong place. Each "Part" should be pointing to the same place that the first "Chapter" following the "Part" points i.e.
Part 1 to Chapter 1 Part 2 to Chapter 3 Part 3 to Chapter 4 Part 4 to Chapter 8 Part 5 to Chapter 13 So we need to use Calibre Tweak-epub to tweak toc.ncx, in your text editor, so that it does. Here is the relevant section for "Part 1" in the toc.ncx in my version of the epub: Code:
<navPoint id="e2c7f948-bfe9-41ab-96e3-b664d1569949" playOrder="2"> <navLabel> <text>Part 1 ~ Earth Time</text> </navLabel> <content src="SMem2utf8_split_002.htm#calibre_toc_2"/> </navPoint> <navPoint id="7ee7a724-dd85-4146-951f-235ca86c50da" playOrder="3"> <navLabel> <text>Chapter 1: The Awakening</text> </navLabel> <content src="SMem2utf8_split_003.htm"/> <navPoint id="20319fe0-acfe-49bb-9a46-53231822216a" playOrder="4"> <navLabel> <text>A Gift for Someone…</text> </navLabel> <content src="SMem2utf8_split_003.htm#calibre_toc_30"/> </navPoint> ... and similarly for "Part 2": Code:
<navPoint id="db1618d1-bc2e-412c-ac9e-e5e99bc7dbd8" playOrder="21"> <navLabel> <text>Part 2 ~ Day One</text> </navLabel> <content src="SMem2utf8_split_004.htm#calibre_toc_5"/> </navPoint> <navPoint id="1cb9e2c9-392e-46df-aa07-d370c3e7ecf7" playOrder="22"> <navLabel> <text>Chapter 3: The Prophecy</text> </navLabel> <content src="SMem2utf8_split_005.htm"/> When you've finished, save toc.ncx. Close the text editor. Close the file browser window (listing all the files inside the epub). Click on "Rebuild epub". View epub in Calibre Viewer and click on each "Part" in the TOC to make sure it now points to the right place. ...and that should be it... By the way I've opened a new ticket in Calibre Bugs. If the powers-that-be agree that it is a bug then it should get fixed so that no toc.ncx tweaking would be necessary. Sometimes these things get fixed very quickly, occasionally they don't, so don't hold your breath. Good Luck ![]() Last edited by jackie_w; 11-05-2010 at 04:19 AM. |
![]() |
![]() |
![]() |
#24 | |
Enthusiast
![]() Posts: 31
Karma: 10
Join Date: Oct 2010
Location: Arizona, USA
Device: None
|
Almost!!! I made all the changes you specified in Post 23, but it's still slightly off ... as follows:
Quote:
|
|
![]() |
![]() |
![]() |
#25 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
I think you've changed the toc.ncx items the wrong way round, i.e. you've changed blue to match red instead of red to match blue. If it's easier to remember change the upper <content> item to match the lower <content> item and leave the lower item alone.
Taking 'Part 1' as an example, after the edit both the 'Part 1' and 'Chapter 1' should look like Code:
<content src="SMem2utf8_split_003.htm"/>
|
![]() |
![]() |
![]() |
#26 | ||
Enthusiast
![]() Posts: 31
Karma: 10
Join Date: Oct 2010
Location: Arizona, USA
Device: None
|
Quote:
I took the further step of converting the EPUB to MOBI and that also looks perfect when viewed in the Kindle reader I have on my Mac. It looks like Sacred Memories is ready to go up on the website as an ebook. I cannot thank you enough for all your help, Jackie. Your explanations were precise, clear, remarkably well organized and easy to follow ... including (and especially) Post 23: Quote:
![]() |
||
![]() |
![]() |
![]() |
#27 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
You're welcome
![]() |
![]() |
![]() |
![]() |
Tags |
calibre conversion, chapter detection, page breaks, table of contents, word conversion |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Table of Contents | peterinnes | Sigil | 1 | 09-29-2010 03:03 AM |
Help with my Table of Contents | Skylinefranc | Calibre | 0 | 03-19-2010 12:55 AM |
How to: table of contents | wizzofoz | Sigil | 1 | 10-08-2009 08:22 AM |
only the table of contents | wang960 | Sony Reader | 3 | 08-29-2008 12:45 PM |
Creator Table of Contents | Nate the great | Kindle Formats | 5 | 07-10-2008 05:55 AM |