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

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 03-11-2011, 10:29 AM   #1
Algiedi
Overenthusiastic Noob
Algiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-books
 
Algiedi's Avatar
 
Posts: 69
Karma: 896
Join Date: Feb 2011
Location: France
Device: Kindle 3
Different text in TOC & actual chapter title

Hello everyone!

Very simply, what I'm trying to do, converting from html to mobi is:

When the actual chapter title in the book is "1", I want the corresponding TOC line to say "Chapter 1".

Can I do this with the Calibre XPath TOC generator thingy?

I've tried making a TOC by hand (anchor + links) but when I upload the book to my Kindle, the "GoTo" function doesn't detect the TOC even when using the <a name="TOC"/> tag.
Algiedi is offline   Reply With Quote
Old 03-11-2011, 10:55 AM   #2
theducks
Grand Sorcerer
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: 15,220
Karma: 5940081
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
I use Sigil to modify my epub files (and I don't own a Kindle )

Code:
<h3 title="Chapter 1">1</h3>
Sigil builds the Nested TOC off of "H" tags. This 'trick' also works when the chapter title is an <img ... tag (the 'alt' value does not appear in the TOC )
theducks is offline   Reply With Quote
 
Advertisement
Old 03-11-2011, 11:06 AM   #3
Algiedi
Overenthusiastic Noob
Algiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-books
 
Algiedi's Avatar
 
Posts: 69
Karma: 896
Join Date: Feb 2011
Location: France
Device: Kindle 3
I found the solution to part #2 of my problem (making the Kindle recognize my "hand-made" TOC as such) by chance while browsing a completely unrelated thread (seriously, does this only happen to me?).

But the reason I was asking whether Calibre has a sort of "add 'Chapter' to all entries" function hidden somewhere was precisely to avoid the manual tagging of all chapters - whether by adding anchors or titles.

But I'll try Sigil anyway. Even though I'm not gonna make epubs, it's bound to come in handy.
Algiedi is offline   Reply With Quote
Old 03-11-2011, 05:27 PM   #4
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
Quote:
Originally Posted by Algiedi View Post
I found the solution to part #2 of my problem (making the Kindle recognize my "hand-made" TOC as such) by chance while browsing a completely unrelated thread (seriously, does this only happen to me?).

But the reason I was asking whether Calibre has a sort of "add 'Chapter' to all entries" function hidden somewhere was precisely to avoid the manual tagging of all chapters - whether by adding anchors or titles.

But I'll try Sigil anyway. Even though I'm not gonna make epubs, it's bound to come in handy.
I too have a Kindle. I've never found any reason to use any editing & creation tools other than Sigil and Calibre. As far as I'm concerned, it's impossible to beat the Sigil/Calibre one-two punch. If I'm converting from another format, I convert to epub and edit in Sigil. If I'm creating from scratch, I start in Sigil. I get everything perfected, just exactly the way I want it, then do a final conversion to mobi with Calibre.

As far as how to have different text show up in the toc, that's really easy. Most ebooks use the "h" tags to setup toc entries. As part of the tag, add title="whatever text you want to show up" and that text will be displayed rather than the actual text you see on the screen. It works the same if you want to use an image as the chapter header but have text show up in the toc.

If you're toc is a simple, one layer/linear toc, just use the Sigil toc editor and "h" tags and Calibre will automatically create the toc for you upon conversion. If your toc has multiple or nested levels, you should probably create a proper toc file in the ebook but, again, that's pretty easy after you've experimented and looked at some other ebooks to see how it's done.

I hope this helps a little. Let me know if you need any more assistance or advice. I'll be glad to pass on what I've learned if I can.

- Byron
bfollowell is offline   Reply With Quote
Old 03-11-2011, 05:54 PM   #5
chyron8472
Groupie
chyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead communitychyron8472 has become a pillar of the MobileRead community
 
chyron8472's Avatar
 
Posts: 175
Karma: 15942
Join Date: Jan 2011
Device: Kindle 2
Quote:
Originally Posted by bfollowell View Post
I too have a Kindle. I've never found any reason to use any editing & creation tools other than Sigil and Calibre. As far as I'm concerned, it's impossible to beat the Sigil/Calibre one-two punch. If I'm converting from another format, I convert to epub and edit in Sigil. If I'm creating from scratch, I start in Sigil. I get everything perfected, just exactly the way I want it, then do a final conversion to mobi with Calibre.
This. All of it.
chyron8472 is offline   Reply With Quote
Old 03-12-2011, 02:00 PM   #6
Algiedi
Overenthusiastic Noob
Algiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-books
 
Algiedi's Avatar
 
Posts: 69
Karma: 896
Join Date: Feb 2011
Location: France
Device: Kindle 3
Well I took a quick look at Sigil and it's definitely not going to work for me, if only because it doesn't match my usual workflow at all. I've taken the habit of using Notepad++ to edit the file (<3 RegEx) together with a somewhat generic css I reuse in every file, and sometimes Kompozer to finetune the css when I wanna tweak indents or margins a bit (although it tends to lag like a b***h on the bigger files).

So I don't think that Sigil would fit into this :P

Which was okay because I realized that making a TOC "by hand" (with anchors and links) is very satisfying... except I'm now facing a new problem, which is that Calibre duplicates the TOCs, even when ticking "don't add detected chapters" -.-
Algiedi is offline   Reply With Quote
Old 03-12-2011, 02:47 PM   #7
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
Quote:
Originally Posted by Algiedi View Post
Well I took a quick look at Sigil and it's definitely not going to work for me, if only because it doesn't match my usual workflow at all. I've taken the habit of using Notepad++ to edit the file (<3 RegEx) together with a somewhat generic css I reuse in every file, and sometimes Kompozer to finetune the css when I wanna tweak indents or margins a bit (although it tends to lag like a b***h on the bigger files).

So I don't think that Sigil would fit into this :P

Which was okay because I realized that making a TOC "by hand" (with anchors and links) is very satisfying... except I'm now facing a new problem, which is that Calibre duplicates the TOCs, even when ticking "don't add detected chapters" -.-
From the steps you've described and the problems you've mentioned, I'm thinking it is exactly your usual workflow that needs changing

You wouldn't have near the problems you're describing.

I really have trouble understanding why you'd want to use Notepad++ to edit your file rather than a WYSIWYG editor designed for ebooks. To me it seems sort of like someone still developing web pages by hard-coding in a text editor instead of using a real web development tool.

That's just me though and it's your work flow. You do what you want.

I wish you the best of luck however you decide to proceed.

- Byron
bfollowell is offline   Reply With Quote
Old 03-12-2011, 03:29 PM   #8
Algiedi
Overenthusiastic Noob
Algiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-books
 
Algiedi's Avatar
 
Posts: 69
Karma: 896
Join Date: Feb 2011
Location: France
Device: Kindle 3
I gotta say that this workflow is both young and sort of an improvisation. I only got a Kindle a few weeks ago and I gotta say that when you know nothing about coding and ebooks, it's all very overwhelming - I took cues from whichever website or forum thread I happened to land on, leading to quite a circumvoluted method made from bits and pieces.
My forum peregrinations only lead me to discover Sigil a couple of days ago, so I still have much learning to do

I however quickly realized that I'm somewhat of a control freak when it comes to my ebooks, and I can't stand finding a stray tag that I didn't put myself, or being unable to check exactly what it does in the css or to tweak the quotes' bottom margin whenever I feel it's 1pt too wide.

I also might have gone overboard with my "formatting options". I have set classes for every type of situation: books with Parts and Chapters, Parts that have specific quotes, Chapters that have introductions, Subchapters that need a page-break-before, etc. - all of those having different text sizes, indents or margins - depending on the book, of course.

Also I might need to mention that most of my ebook-making has to do with free content: public domain books, fanfic, essays, etc. that are published on websites and that often need a lot of precise formatting to be readable.

But you guys really made me wanna look at the whole process from a fresh perspective so I'll give Sigil another try, and try to let go of the formatting OCDs.
Algiedi is offline   Reply With Quote
Old 03-12-2011, 05:04 PM   #9
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
Don't feel too badly. I'm the same way. I think I just go about things a little differently and feel my processes are probably a little more matured than yours (of course I'd feel that way, they're my processes, right? ) I've definitely come a long way in six months of editing/creating/converting. I've learned a lot, forgotten a lot, picked up a lot of bad habits, dropped them and learned more. My processes have changed considerably in that time and my results show for it. Never let yourself get so confined by a process that you can't or won't use a better method, or at least try something new when it comes along.

Trust me though, I'm every bit as anal retentive when it comes to my ebook formatting, and there's nothing wrong with that.

Just find a method that works for you but, at the same time, is as easy on you as it can be.

Also, if you haven't downloaded it yet, another useful tool is the Amazon Kindle Previewer. It's basically a Kindle emulator and will show you what your mobi file will look like on your Kindle. While Calibre will let you view a mobi file, it won't give you any idea what it will really look like on a real-live Kindle.

- Byron
bfollowell is offline   Reply With Quote
Old 03-12-2011, 06:15 PM   #10
Algiedi
Overenthusiastic Noob
Algiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-booksAlgiedi has learned how to read e-books
 
Algiedi's Avatar
 
Posts: 69
Karma: 896
Join Date: Feb 2011
Location: France
Device: Kindle 3
Quote:
Originally Posted by bfollowell View Post
Never let yourself get so confined by a process that you can't or won't use a better method, or at least try something new when it comes along.
Words of wisdom.

And thanks a lot for the tip about the Kindle Previewer!
Algiedi is offline   Reply With Quote
Old 03-12-2011, 11:32 PM   #11
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: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Algiedi View Post
Well I took a quick look at Sigil and it's definitely not going to work for me, if only because it doesn't match my usual workflow at all. I've taken the habit of using Notepad++ to edit the file (<3 RegEx) together with a somewhat generic css I reuse in every file, and sometimes Kompozer to finetune the css when I wanna tweak indents or margins a bit (although it tends to lag like a b***h on the bigger files).
I'm not a big ebook creator or editor, but Sigil will allow you, in code view, to search and replace using RegEx on the entire book. It will also let you edit the css file as you see fit, even dropping in an entirely new structure if you want. Plus it has a TOC editor that automatically creates a proper TOC from <h> tags.

Quote:
Originally Posted by Algiedi View Post
So I don't think that Sigil would fit into this :P
Sigil might not work for you but it is more flexible and powerful than a first glance might reveal.
DoctorOhh is offline   Reply With Quote
Old 03-13-2011, 07:09 AM   #12
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by Algiedi View Post
Which was okay because I realized that making a TOC "by hand" (with anchors and links) is very satisfying... except I'm now facing a new problem, which is that Calibre duplicates the TOCs, even when ticking "don't add detected chapters" -.-
Are you also selecting "Do not add table of contents to book" in the "MOBI Output" section of the conversion dialog? The combination of those two settings should ensure that Calibre doesn't add a second inline TOC to the MOBI version.

Also, just a clarification - the "TOC" that others refer to Sigil creating is not an inline TOC as required in a MOBI file. What Sigil creates is a navigation control XML file (an NCX file) which most/all EPUB readers use to generate a TOC to present to the user. The Kindle device and apps use the NCX file (when one is incorporated into a MOBI file) to provide previous/next chapter navigation (on the Kindle, using the 5-way control button), and to show each navigation point as a small dot or tick mark on the progress bar. In most MOBI readers, and certainly true for the Kindle and Kindle apps, the only kind of TOC that will be presented to the user viewing a MOBI file is an inline TOC, coded as part of the HTML content of the book. That's the TOC referred to in Calibre's conversion dialog when MOBI is selected as the output format.
DMSmillie is offline   Reply With Quote
Old 03-13-2011, 07:47 AM   #13
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
Quote:
Originally Posted by DMSmillie View Post
Also, just a clarification - the "TOC" that others refer to Sigil creating is not an inline TOC as required in a MOBI file. What Sigil creates is a navigation control XML file (an NCX file) which most/all EPUB readers use to generate a TOC to present to the user. The Kindle device and apps use the NCX file (when one is incorporated into a MOBI file) to provide previous/next chapter navigation (on the Kindle, using the 5-way control button), and to show each navigation point as a small dot or tick mark on the progress bar. In most MOBI readers, and certainly true for the Kindle and Kindle apps, the only kind of TOC that will be presented to the user viewing a MOBI file is an inline TOC, coded as part of the HTML content of the book. That's the TOC referred to in Calibre's conversion dialog when MOBI is selected as the output format.
Very true. However, Calibre will take the Sigil TOC and create an inline TOC upon conversion from epub to mobi if a TOC file isn't assigned within the epub. If I have a simple, single level TOC, I typically will let Calibre create it for me when I convert. If you have multiple levels or special formatting desires though, it's best to create your own TOC file in Sigil, mark designate it as TOC and then convert.

- Byron
bfollowell is offline   Reply With Quote
Old 03-13-2011, 08:09 AM   #14
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Quote:
Originally Posted by bfollowell View Post
...Calibre will take the Sigil TOC and create an inline TOC upon conversion from epub to mobi...
As far as I know, Calibre creates that inline TOC by parsing the HTML content, not from the NCX file.

There's also the issue of Calibre placing that inline TOC at the end of the book, which isn't exactly where users would expect to find it. Of course, that's only an issue if you plan on distributing the ebook to others. If it's purely for your own consumption, it becomes simply a matter of personal preference.
DMSmillie is offline   Reply With Quote
Old 03-13-2011, 09:04 AM   #15
bfollowell
Fanatic
bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.bfollowell ought to be getting tired of karma fortunes by now.
 
Posts: 515
Karma: 1152752
Join Date: Aug 2010
Location: Evansville, IN, USA
Device: Amazon Kindle 3 Wi-Fi & B&N Nook Tablet & B&N Nook HD+
Quote:
Originally Posted by DMSmillie View Post
There's also the issue of Calibre placing that inline TOC at the end of the book, which isn't exactly where users would expect to find it. Of course, that's only an issue if you plan on distributing the ebook to others. If it's purely for your own consumption, it becomes simply a matter of personal preference.
Right again. I wasn't thinking clearly. It's not that Calibre creates the in-line TOC from the NCX. It's that the NCX and the in-line TOC Calibre creates both originate from the same code. Gotta remember that.

I like having a TOC in my ebooks, in-line for mobis for my Kindle, but I don't want to have to scroll through it at the beginning of all my books, so I always put mine at the end anyway. Like you said, where it gets put is a personal choice. You can put it whereever you want if you create it yourself but if you let Calibre create it for you, it's definitely going to be in the back. That's great for me. Maybe not so much for someone else.

- Byron
bfollowell 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
Calibre settings for using 'chapter' in TOC TargonD Calibre 13 11-03-2010 09:57 PM
Les Miserables - TOC / Chapter Flags? gshipley Amazon Kindle 1 09-28-2009 11:07 PM
ADE and long chapter names in ToC frabjous Reading and Management 3 08-14-2009 12:16 PM
Chapter or TOC Creation help needed gandor62 Calibre 4 04-15-2009 03:18 PM
html2epub TOC and chapter detection help ilovejedd Calibre 6 02-22-2009 06:58 PM


All times are GMT -4. The time now is 10:23 PM.


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