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-03-2011, 08:51 AM   #1
CoffeeCup
Junior Member
CoffeeCup began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 Wi-Fi
Table Of Contents - Appearance

Hi, All.

I convert html books to mobi with calibre. It works pretty well. It do create appropriate table of contents with all the working links. I use h2 and h3 tags to create nested table of contents. Everything is Ok with conversion.

The only thing I'd like to improve in resulting mobi files is the appearance of the created table of contents. To be more specific: if a toc entry is too long and occupy two lines it looks as justified alignment but not as left alignment which I prefer. Are there any way to do the left alignment for the toc entries?

One more question, is it possible to insert a custom designed text to the Table of Contents page?
CoffeeCup is offline   Reply With Quote
Old 03-03-2011, 11:56 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,436
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can use the toc title option to change the text of "Table of Contents" but other than that no customization is possible without editing the source code.
kovidgoyal is offline   Reply With Quote
Old 03-04-2011, 04:27 AM   #3
CoffeeCup
Junior Member
CoffeeCup began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 Wi-Fi
If it is possible by modifying the html source of the book what code should I add to the source?

I can imagine two ways:

the first is modifying some css which affect the "Table of Contents" formatting

or the second is to make my own formatted page with the list of contents links within the html source and to mark this part of the html code in someway which makes the calibre to use this html code instead of the auto-generated "Table of Contents".

So the question is how to do this, or where can I find some instructions how to do this?
CoffeeCup is offline   Reply With Quote
Old 03-04-2011, 04:34 AM   #4
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I think Kovid was talking about Calibre's source code, not the HTML of the book.
Manichean is offline   Reply With Quote
Old 03-04-2011, 05:37 AM   #5
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 2,336
Karma: 3943904
Join Date: May 2008
Location: Launceston, Tasmania
Device: Kindle3, Kobo Touch, Sony PRS T3, Nexus 7, iPad mini
Im' not at all sure what Kovid means by 'source code', but when preparing books in ePub format I've started to use a numbered list for the chapter headings, and the CSS is

div#TOC {
margin: 0;
padding: 2em 0 2em 0;
page-break-after: always;
text-align: left;
} /* Sets a top and bottom margin for TOC, and page break */
div#TOC p { text-indent: 3%; font-size: larger; padding-bottom: 0.2em;}
div#TOC li { font-size: larger; padding-bottom: 0.2em; margin-left: 3%; }

The HTML looks something like

<div id="TOC">
<h2>Table of Contents</h2><hr />
<p><a href="#coverpage">Cover page</a></p>
<p><a href="#titlepage">Title and Copyright page</a></p>
<p><a href="#authorpreface">Preface by the Author</a></p>
<p><a href="#intro">Introduction by the Editor</a></p>
<p><a href="#preface">Preface to this edition</a></p>
<ol>
<li><a href="Ch01.html">Childhood</a></li>
<li><a href="Ch02.html">The New Master and Mistress</a></li>
<li><a href="Ch03.html">The Slaves' New Year's Day</a></li>

<-- Deleted to save space -->

<li><a href="Ch38.html">Renewed Invitations to Go South</a></li>
<li><a href="Ch39.html">The Confession</a></li>
</ol>
<p><a href="Endmatter.html#afterword">Afterword</a></p>
<p><a href="Endmatter.html#endnotes">End notes</a></p>
<p><a href="Endmatter.html#colophon">Colophon</a></p>
</div><!-- End of TOC div; page break is in the CSS -->

Does this make sense?

I really have no idea what it would look like when converted from ePub to mobi.

Regards, Alex

PS. Do you use the CoffeeCup HTML editor?

Last edited by AlexBell; 03-04-2011 at 05:39 AM. Reason: To add PS
AlexBell is offline   Reply With Quote
Old 03-04-2011, 06:37 AM   #6
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
For Mobi conversion DMSmilie came up with a solution. Create an inline TOC in an epub source with whatever formatting you desire. Then you need to do some hand tweaking to the epub which will clue Calibre in to use your custom TOC in the mobi output.

Read more here:
http://www.mobileread.com/forums/sho...d.php?t=123170
ldolse is offline   Reply With Quote
Old 03-04-2011, 08:35 AM   #7
CoffeeCup
Junior Member
CoffeeCup began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 Wi-Fi
Thanks for the responses. I'll check the possibility to format "Table of Contents" via epub.

Quote:
PS. Do you use the CoffeeCup HTML editor?
PS. No. I just don't mind to get a cup of good coffee.
CoffeeCup is offline   Reply With Quote
Old 03-09-2011, 06:30 AM   #8
CoffeeCup
Junior Member
CoffeeCup began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 Wi-Fi
Thanks ldolse, once again. The idea from the topic you've mentioned does work well.

So to create my own "table of contents" I prepared at the end of my html source of the book my own page with links in the way I like. Then I converted it to epub with Calibre and tweaked epub with Calibre in the way described in that topic and at last converted the epub to mobi. As a result I've got the mobi with working "table of contents" formatted in the way I need.
CoffeeCup 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 taraboom11 Sigil 20 04-30-2011 12:18 PM
Table of Contents ucoa Calibre 1 01-07-2011 10:01 PM
Table of Contents peterinnes Sigil 1 09-29-2010 04:03 AM
How to: table of contents wizzofoz Sigil 1 10-08-2009 09:22 AM
only the table of contents wang960 Sony Reader 3 08-29-2008 01:45 PM


All times are GMT -4. The time now is 07:29 AM.


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