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 07-07-2010, 07:55 PM   #1
banjobama
Busy Read'n
banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.
 
banjobama's Avatar
 
Posts: 980
Karma: 5039283
Join Date: Feb 2010
Location: Auburn, WA
Device: Pocketbook Touch Lux 5
Make Table of Contents?

Is there a way to use Calibre to make a table of contents that I can use on my Sony Reader when I access the Table of Contents function? I want to make it so I can skip between stories (complete works of H.P. Lovecraft) without having to return to the first page and use the hyperlink-style ToC that is there. Just a convenience thing. Thanks in advance if anyone knows.
banjobama is offline   Reply With Quote
Old 07-08-2010, 07:55 AM   #2
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Yes, this is straightforward. I do this when generating epub books to use on my Sony reader and I never use an inline hyperlink style TOC.

It's all defined on the "Table of Contents" page during the conversion. (You can also set defaults for this page in the calibre preferences). How you then fill in the fields depends on what type of source code you are using for input. Are you using plain text, html or something else?

Last edited by Agama; 07-08-2010 at 09:08 AM.
Agama is offline   Reply With Quote
Advert
Old 07-08-2010, 09:49 AM   #3
Chrysanthemum
Enthusiast
Chrysanthemum began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Jul 2010
Location: Midwest, USA
Device: Kindle Paperwhite 2,
Quote:
Originally Posted by Agama View Post
It's all defined on the "Table of Contents" page during the conversion. (You can also set defaults for this page in the calibre preferences). How you then fill in the fields depends on what type of source code you are using for input. Are you using plain text, html or something else?
I was watching this thread because I am also curious about this. I looked at the "Table of Contents" page inside 'Preferences->Conversion', but I am honestly confused. I clicked on the XPath Tutorial hoping to learn how to use this, but it did not really explain what XPath was for. It just began explaining how to write XPath code. Reading carefully, I was able to understand the basics of writing it. I just don't understand how to know what I want to write.

I use Open Office to create odt files that I then put through Calibre ePub conversion. Because I didn't know how to make chapter links work in the Table of Contents I just deleted the Table of Contents from the files. (I found it annoying to have to page through the Table of Contents when it had no use to me other than to inform me that there were chapters.) These files are books I copy and paste from the internet - so I guess they are originally HTML - but paste them into Open Office. The Table of Contents is there in the original file, and clicking on the links opens a web page with that chapter. I'm guessing there is a way to make them open the chapter inside the ebook instead, I just don't grasp the process of how to achieve this.
Chrysanthemum is offline   Reply With Quote
Old 07-08-2010, 06:28 PM   #4
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Can I add attachments to this forum or should I just paste html code directly into my reply? (This is the first forum I've ever joined and I'm still figuring out how it all works!). It would be easiest to show you with a simple example. I tried the insert link tool button but it appears to be for a hyperlink rather than an attachment.
Agama is offline   Reply With Quote
Old 07-08-2010, 06:49 PM   #5
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: 30,397
Karma: 58055234
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Agama View Post
Can I add attachments to this forum or should I just paste html code directly into my reply? (This is the first forum I've ever joined and I'm still figuring out how it all works!). It would be easiest to show you with a simple example. I tried the insert link tool button but it appears to be for a hyperlink rather than an attachment.
Wrap the in a Code tag
Code:
(the # icon)
then wrap those with the "spoiler" Icon (eye with X)
theducks is offline   Reply With Quote
Advert
Old 07-08-2010, 08:24 PM   #6
banjobama
Busy Read'n
banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.
 
banjobama's Avatar
 
Posts: 980
Karma: 5039283
Join Date: Feb 2010
Location: Auburn, WA
Device: Pocketbook Touch Lux 5
I have no idea whatsoever what I'm doing. I was hoping it would be similar to Word, which will generate a table of contents for you. I made all the story names in a header format, then Word detects those and automatically makes a ToC to link back to the page. It looks like there's a way to have Calibre detect headings in that same kind of way but I don't know how to make it do that.
banjobama is offline   Reply With Quote
Old 07-08-2010, 08:43 PM   #7
banjobama
Busy Read'n
banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.
 
banjobama's Avatar
 
Posts: 980
Karma: 5039283
Join Date: Feb 2010
Location: Auburn, WA
Device: Pocketbook Touch Lux 5
Okay, so I took a shot in the dark and I think I have it figured out. I had a PDF file and I converted it to epub with table of contents. Problem is all the nice PDF formatting is gone. I'll just use the hyperlink ToC for this one. Thanks everybody anyway!
banjobama is offline   Reply With Quote
Old 07-08-2010, 09:17 PM   #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,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by banjobama View Post
... I was hoping it would be similar to Word, which will generate a table of contents for you. I made all the story names in a header format, then Word detects those and automatically makes a ToC to link back to the page. It looks like there's a way to have Calibre detect headings in that same kind of way but I don't know how to make it do that.
If you have your source ebook in MSWord then you can use this approach for a simple single-level TOC:-
  1. Apply Word built-in style "Heading 2" to each story heading

  2. Save-As Webpage-filtered. This will convert your ebook to HTML format and each story heading will be enclosed in <h2>...</h2> tags.

  3. Import the HTML book into Calibre, which will zip up your HTML and any associated images into a .zip file.

  4. Convert book from ZIP to EPUB.
    In [Convert] - [Structure Detection] set "Detect chapters at" to //h:h2
    In [Convert] - [Table of Contents] set "Level 1 TOC" to //h:h2

  5. This will create an EPUB with a TOC with one entry per story. The TOC will not be seen in the book as part of the text but will be available on your Sony Reader when you choose the TOC menu item. The TOC is also accessible if you open the EPUB in Calibre's ebook viewer and press the TOC button.

Once you get the hang of a single-level TOC you can experiment with a 2-level TOC.

Proceed as before with the following additions:-
In 1/2 above, style each chapter heading within each story as built-in style "Heading 3"
When you Save-As Webpage-filtered each chapter heading will be wrapped in <h3>...</h3> tags.

In 4. above:
[Convert] - [Structure Detection] change "Detect chapters at" to //*[name()='h2' or name()='h3']
[Convert] - [Table of Contents] add "Level 2 TOC" to //h:h3

The resulting EPUB will have a nested 2-level TOC

+Story 1
Chapter 1
Chapter 2
...
+Story 2
Chapter 1
Chapter 2
...
jackie_w is offline   Reply With Quote
Old 07-09-2010, 02:22 AM   #9
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Thanks jackie_w, I couldn't have put it better. That's basically what I do, except that my starting documents are html or plain-text with markdown.

One other point to note is that you can also have TOC entries within a chapter. For example if you want <h4> tags to generate a Level 3 TOC, (to mark sections within a chapter), then add to step 4 above:

In [Convert] - [Table of Contents] set "Level 3 TOC" to //h:h4

but do NOT add h4 to the [Structure Detection] so it won't break the chapter.

Calibre has even more flexibility in this area because you can be selective about when a tag produces a TOC entry. For example you may want <h4 class="toc"> to produce an entry, but <h4 class="notoc"> not to. Just click on the Xpath helper button on [Table of Contents], and fill it in as follows:

[Match HTML...] h4
[Having the attribute] class
[With value] toc

I can post a simple html example if anyone is interested but I think that everything is pretty well covered now.

Last edited by Agama; 07-09-2010 at 02:29 AM.
Agama is offline   Reply With Quote
Old 07-09-2010, 04:39 AM   #10
banjobama
Busy Read'n
banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.banjobama ought to be getting tired of karma fortunes by now.
 
banjobama's Avatar
 
Posts: 980
Karma: 5039283
Join Date: Feb 2010
Location: Auburn, WA
Device: Pocketbook Touch Lux 5
Thank you so much everyone. I did what jackie_w said, only with //h:h1 since Heading 1 was the style. The table of contents was perfect but the main text and page flow still work much better as a PDF than as an epub so for now I'm leaving it alone. Thank you again, very helpful!
banjobama is offline   Reply With Quote
Old 07-19-2010, 05:17 PM   #11
silinthar
Junior Member
silinthar began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Feb 2010
Device: ereader on BB Storm
Does this work in mobi format or only epub?
silinthar is offline   Reply With Quote
Old 07-24-2010, 06:27 PM   #12
jasonb57
Enthusiast
jasonb57 has a complete set of Star Wars action figures.jasonb57 has a complete set of Star Wars action figures.jasonb57 has a complete set of Star Wars action figures.jasonb57 has a complete set of Star Wars action figures.
 
Posts: 35
Karma: 300
Join Date: Jan 2009
Device: none
Hi,

I'm having problems creating an ePub TOC using Calibre. I have an RTF that I saved as a web page, filtered file. I edited the html in Notepad and added the h2 class="toc" and in Calibre I set the toc flags to //h:h2.

Anyone out there willing to take a look at my raw file and tell me where I'm going wrong?

Calibre looks like it knows to create a ToC. I get a ToC listing, but clicking on the links within Calibre does nothing and using Firefox ePub add in it leads to erroneous pages.

Jason
jasonb57 is offline   Reply With Quote
Old 07-24-2010, 10:00 PM   #13
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,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
I'm happy to take a look at it tomorrow if you don't find someone sooner.
jackie_w is offline   Reply With Quote
Old 07-24-2010, 10:07 PM   #14
jasonb57
Enthusiast
jasonb57 has a complete set of Star Wars action figures.jasonb57 has a complete set of Star Wars action figures.jasonb57 has a complete set of Star Wars action figures.jasonb57 has a complete set of Star Wars action figures.
 
Posts: 35
Karma: 300
Join Date: Jan 2009
Device: none
Quote:
Originally Posted by jackie_w View Post
I'm happy to take a look at it tomorrow if you don't find someone sooner.
Great. Shoot me your email at jason at apexbookcompany.com.

jasonb57 is offline   Reply With Quote
Old 06-21-2011, 08:39 PM   #15
Themus
Zealot
Themus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-booksThemus has learned how to read e-books
 
Posts: 133
Karma: 998
Join Date: Apr 2010
Device: Nook
Jackie, your are life saver!

Now one 'dumb' question. Can I create a TOC inside my ePub with Calibre? I know I can with MobiCreator, but I am hoping I can skip using that application and move directly to Calibre. Otherwise, I have to use MobiCreator for the internal, inside the ePub TOC, and then import that into Calibre to get my final product.
Themus 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
Table of Contents peterinnes Sigil 1 09-29-2010 03:03 AM
How to make a PDF table of contents work in epub ajbrutico Calibre 3 09-26-2010 09:31 AM
how does the kobo make it's "table of contents" soup Kobo Reader 5 08-17-2010 10:24 PM
Help with my Table of Contents Skylinefranc Calibre 0 03-19-2010 12:55 AM
Creator Table of Contents Nate the great Kindle Formats 5 07-10-2008 05:55 AM


All times are GMT -4. The time now is 09:10 AM.


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