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 05-03-2011, 01:46 PM   #16
Ron.
Evangelist
Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.Ron. ought to be getting tired of karma fortunes by now.
 
Ron.'s Avatar
 
Posts: 448
Karma: 864744
Join Date: Mar 2011
Device: Kindle 3, LookBook, Nook Simple Touch
Quote:
Originally Posted by DMSmillie View Post
I don't know of any way to do what you want, medwatt, without doing some manual editing of the XML/XHTML files used to create the EPUB and MOBI files. I was hoping someone might come up with a suggestion that didn't involve that, but it looks like it isn't currently possible.

One possible route might be:
  1. Create a bookmark at the start of your inline TOC (could do that in Word before creating the EPUB version).
  2. Use Calibre's "tweak epub" facility to open up the EPUB and edit the OPF file (using a plain text editor), and add a Guide item of type "toc" to point to that bookmark. E.g.:
    Code:
    <guide>
    <reference type="toc" title="Table of Contents" href="filename.html#bookmark"/>
    </guide>
  3. Save and reform the EPUB file.
  4. Convert to MOBI format.
I haven't tested this, so I don't know what issues it might throw up, but it might be worth trying.
Great tip thanks for sharing
Ron. is offline   Reply With Quote
Old 05-06-2011, 06:44 PM   #17
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,998
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Keep your document well away from Word. The garbage put in by Word is a pain in the ass to deal with.

And since you are dealing with ePub, you do not need an internal ToC. Just use the NCX for the ToC and Calibre will convert that so the link to the ToC works.
JSWolf is offline   Reply With Quote
Advert
Old 05-06-2011, 06:46 PM   #18
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,998
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
When I see an ePub with both an internal and external ToC and I am making any changes to the ePub, I will delete the internal ToC as it is not needed and just takes up space.
JSWolf is offline   Reply With Quote
Old 04-03-2012, 10:22 PM   #19
maryjanee
Junior Member
maryjanee began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2012
Device: calibre
DMSmillie your suggestion is just what i'm look for. but i need more explanation please.
when i "tweak epub" it brings up a bunch of files. which is the OPF file and how do i open it to add you fix?

where in the file do i add your <guide> code?

thank you for you help
maryjanee
maryjanee is offline   Reply With Quote
Old 04-03-2012, 11:22 PM   #20
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by maryjanee View Post
DMSmillie your suggestion
Most of the time folks should not revive an old thread. The last time DMSmillie logged into this forum was 19 Apr 2011, but maybe she will see this request in her email and come on back to respond.

I hope you get the help you require.
DoctorOhh is offline   Reply With Quote
Advert
Old 04-04-2012, 01:13 AM   #21
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by maryjanee View Post
DMSmillie your suggestion is just what i'm look for. but i need more explanation please.
when i "tweak epub" it brings up a bunch of files. which is the OPF file and how do i open it to add you fix?

where in the file do i add your <guide> code?
The file you are looking for is one with the extension "opf". From what I have seen, it is called "content.opf". I don't know if that name is mandatory or just happens to be the one used in the epubs I have opened. It can be in the main directory or a subdirectory.

If there is already a <guide> section, add the <reference> tag inside it. If you need to add <guide> section, it can go anywhere within the <package> section so long as it isn't within a subsection. It is probably easiest to add it just before the </package> tag.
davidfor is offline   Reply With Quote
Old 04-04-2012, 06:31 PM   #22
maryjanee
Junior Member
maryjanee began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2012
Device: calibre
davidfor

that was helpful thanks. i guess i dont understand what to add exactly. i thought i just add the name of my bookmarked toc like this <reference type="toc" title="Table of Contents" href="filename.html#tocc"/> but the kindle previewer said there is no toc.

<reference type="toc" title="Table of Contents" href="filename.html#bookmark"/>
this is the code that works. what exactly should i add?
maryjanee is offline   Reply With Quote
Old 04-04-2012, 10:54 PM   #23
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by maryjanee View Post
davidfor

that was helpful thanks. i guess i dont understand what to add exactly. i thought i just add the name of my bookmarked toc like this <reference type="toc" title="Table of Contents" href="filename.html#tocc"/> but the kindle previewer said there is no toc.

<reference type="toc" title="Table of Contents" href="filename.html#bookmark"/>
this is the code that works. what exactly should i add?
We are stretching my knowledge of this as when I do this, I normally do it in Sigil and let it sort things out. But...

What you need is code that looks something like:
Code:
<guide>
<reference type="toc" title="Table of Contents" href="filename.html#bookmark"/>
</guide>
Firstly, the simple things:

- There can be only one set of <guide></guide> tags.
- There may be other <reference> tags in there. Most will probably have type of "text" but "cover" for the cover page is one I can see.
- For the TOC, everything other than what is in quotes after "href" attribute should be the same.

The href attribute is where the changes are. This refers to a file in the epub and an anchor point within that file. So, there needs to be a file in the epub that has a table of contents in it. This will be html or xhtml file with links to the chapters. One of the tags in the file will have an id which is used as the anchor point. The example of this I can find has a separate file that is just the TOC. I suspect in this case, the anchor point is not needed, but it is there from whoever created the file. The anchor point will be needed if the file contains text other than the TOC.

The example I can find in my library has:
Code:
  <guide>
    <reference href="Text/Twice_Shy_split_024.html#filepos695889" title="Table of Contents" type="toc" />
    <reference href="Text/titlepage.xhtml" title="Cover" type="cover" />
  </guide>
In this, the TOC is contained in a file called "Twice_Shy_split_024.html" that is in a sub directory called "Text". In this file there is a <div> that wraps the actual TOC tags and has an id of "filepos695889". This epub looks like one I converted from mobi and then fiddled with in Sigil. I don't think I went near the TOC file.

As I mentioned, I use Sigil to edit epubs. As an experiment, I edited an epub, selected a file and gave it the semantics of TOC (right click on the file, select "Add Sementics" and then "Table of Contents"). Sigil updated contents.opf to have the tags we are talking about. In this case, there was no id in the href. I don't know what would happen if I converted this epub to mobi as the file I marked as the TOC did not have a TOC in it. I would expect the Kindle to either display the error you are seeing or an empty TOC.
davidfor is offline   Reply With Quote
Old 04-04-2012, 11:08 PM   #24
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
A second for Sigil.
If you right-click on a file in Sigil's Book Browser, you can add a 'Semantic' to that file. Basically making those entries for you.

The ?down side, is one semantic per file (SIgil does not attach semantics to anchors). The up side is it is easy to split a file in Sigil.
theducks is online now   Reply With Quote
Old 04-07-2012, 02:39 PM   #25
maryjanee
Junior Member
maryjanee began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2012
Device: calibre
thank you. i didnt know about Sigil it generates a perfect toc. i REALLY appreciate every ones help. problem solved thanks to helpful people like you.
maryjanee is offline   Reply With Quote
Old 12-16-2012, 07:33 AM   #26
bodypractor
Junior Member
bodypractor began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: none
Hi there,
I just spent... 8 hours... trying to solve this TOC issue. I must precise I'm a complete beginner and non-native English speaker. Sorry if I misunderstand things sometime.

I tried and do what's described here. My first issue is the following:
- if I UNCHECK "Do ot add a TOC to..." like explained by medwatt, my eBook display 2 TOC: the initial, inline one I creatdd in Word, PLUS the "metadata" one at the very end of the ebook. This second one is the one that is recognized when I use the "GO TO... Tables of Contents" functionality.
- When I CHECK the "Do ot add a TOC to..." option, my ebook only display the inline TOC of my Word document. But in piste of me trying to follow the process you describe, I'm unable to have it recognized by the "GO TO..." functionality.

Here is what I did:
1. In Word, I created a Bookmark just before my TOC. I named the bookmark "CIU"so that I do not mistake it with anything else when editing my files.
2. I saved the file as a WEB PAGE, FILTERED.
3. In CALIBRE, I converted that WEB PAGE into EPUB. I had to check the "No default Cover" in the EPUB Ouput option.
4. Still in CALIBRE, I right-clicked on the book and select TWEAK BOOK and EXPODE BOOK.
5. I select the OPF file and open it into WordPad. Here, I'm not sure I'm not already "corrupting" the file format? Is there any free text editor I should better use to do that? Or is there no risk here?
6. I know that my initial TOC is in the file "TT_Test Bkmrk et EPUB_split_002.html" and the bookmark is named CIU.
7. Then it should give me the following:
<reference type="toc" title="Table of Contents" href="TT_Test Bkmrk et EPUB_split_002.html#CIU"/>
My issue is that I do not where to add this line in the OPF file. I can see the <guide/> tag, but I cannot find the <guide> tag.

Then, I'm not even sure that this edit is well-taken into account. Well, I'm not a coder and very new to eBook. Can anyonre please advise me?

Here is my edited OPF file:

Code:
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="uuid_id">
<metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlnspf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/">
<meta name="calibre:title_sort" content="Le TT_BOOKMARK"/>
<dc:language>en</dc:language>
<dc:creator opf:role="aut">Unknown</dc:creator>
<meta name="calibre:timestamp" content="2012-12-16T12:03:01+00:00"/>
<dc:title>Le TT_BOOKMARK</dc:title>
<dc:date>0101-01-01T00:00:00+00:00</dc:date>
<dc:contributor opf:role="bkp">calibre (0.9.10) [http://calibre-ebook.com]</dc:contributor>
<dc:identifier id="uuid_id" opf:scheme="uuid">b3376e2e-2f8e-4252-a4aa-b82187a3f450</dc:identifier>
</metadata>
<manifest>
<item href="TT_Test Bkmrk et EPUB_split_000.htm" id="html7" media-type="application/xhtml+xml"/>
<item href="TT_Test Bkmrk et EPUB_split_001.htm" id="html6" media-type="application/xhtml+xml"/>
<item href="TT_Test Bkmrk et EPUB_split_002.htm" id="html5" media-type="application/xhtml+xml"/>
<item href="TT_Test Bkmrk et EPUB_split_003.htm" id="html4" media-type="application/xhtml+xml"/>
<item href="TT_Test Bkmrk et EPUB_split_004.htm" id="html3" media-type="application/xhtml+xml"/>
<item href="TT_Test Bkmrk et EPUB_split_005.htm" id="html2" media-type="application/xhtml+xml"/>
<item href="TT_Test Bkmrk et EPUB_split_006.htm" id="html1" media-type="application/xhtml+xml"/>
<item href="page_styles.css" id="page_css" media-type="text/css"/>
<item href="stylesheet.css" id="css" media-type="text/css"/>
<item href="toc.ncx" media-type="application/x-dtbncx+xml" id="ncx"/>
</manifest>
<spine toc="ncx">
<itemref idref="html7"/>
<itemref idref="html6"/>
<itemref idref="html5"/>
<itemref idref="html4"/>
<itemref idref="html3"/>
<itemref idref="html2"/>
<itemref idref="html1"/>
</spine>
<reference type="toc" title="Table of Contents" href="TT_Test Bkmrk et EPUB_split_002.html#CIU"/>
<guide/>
</package>
bodypractor is offline   Reply With Quote
Old 12-16-2012, 11:13 AM   #27
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
the guide shown there is of the self closing format.
simply change it to <guide>
put your stuff
and add the closing </guide> after
theducks is online now   Reply With Quote
Old 12-18-2012, 05:55 PM   #28
bodypractor
Junior Member
bodypractor began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: none
That's what I did, but my TOC is still not recognized when using the GO TO function. I'm just turning crazy with that issue. I spent like over 8 hours on it researching and testing all solutions I have found in forums.

Another issue of mine: my COLORED cover page is turned into a black & white page when I open my eBook in KindlePreviewer.

Who will be the magician helping tring to find a work-around?
bodypractor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
create TOC for every X pages omegauo Conversion 0 03-21-2011 01:45 AM
Create Newspaper TOC plantoschka Kindle Formats 2 09-09-2010 02:03 PM
Txt to Epub: how to create a toc nestol Calibre 0 08-09-2010 08:56 PM
How to create a TOC from scratch? greenapple Sigil 5 06-01-2010 02:20 AM
How to create linked TOC? squawker Sony Reader 1 03-04-2007 08:20 AM


All times are GMT -4. The time now is 02:57 AM.


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