Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-03-2008, 03:17 AM   #1
sahlberg
Junior Member
sahlberg began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Oct 2008
Device: prs-505
Table of content troubles with HTML2LRF

I just can not fugure out how to do this so please help me :-)

In the HTML book I am marking up I am using chapterheadings and subheadings.
A chapter would thus look something like this in the HTML :

<h2>CHAPTER I</h2>
<h3>name of chapter</h3>

Now I want to have a nice table of content in my LRF book, but I want the entries to look slightly differently!
I want this to show up as
"CHAPTER 1: name of chapter"
in the TOC.


This is what I have tried, trying to use "hidden" headings so they would not show up in the book itself but (and I was naive enough to think that it would still show up in the TOC :-( )

<h2 class='lrfchapter' style='visibility: hidden'>CHAPTER I: name of chapter</h2>
<h2>CHAPTER I</h2>
<h3>name of chapter</h3>
and then running html2lrf with the arguments :
--no-links-in-toc --add-chapters-to-toc --chapter-attr="h2,class,lrfchapter"


This doesnt work because the entries show up with "unknown" due to the visibility: hidden style.


Does anyone have any suggestions on how I can do this?
Is it possible?
sahlberg is offline   Reply With Quote
Old 11-03-2008, 03:29 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: 45,279
Karma: 27111060
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can use lrf2lrs+lrs2lrf and edit the entries manually. Or you can use html2epub and style="height:0pt" for the elements you want hidden.
kovidgoyal is online now   Reply With Quote
Advert
Old 11-03-2008, 04:23 AM   #3
sahlberg
Junior Member
sahlberg began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Oct 2008
Device: prs-505
Quote:
Originally Posted by kovidgoyal View Post
You can use lrf2lrs+lrs2lrf and edit the entries manually. Or you can use html2epub and style="height:0pt" for the elements you want hidden.
Thanks, I tried that and also font-size: 0pt and color: white to no avail.


But I found a way that worked well enough, not exactly what i wanted, but good enough. In case someone else has a similar issue :


SOLUTION:

It is possible to have multiple lines for a chapter heading/subheading in the book but still have it collapsed to a single line in the table of contents :
('lrfchapter' is just a dummy class that does not exist)
<div class='lrfchapter'>
<h2>CHAPTER X</h2>
<h3>On the road again</h3>
</div>
Can be used togehter with
--no-links-in-toc --add-chapters-to-toc --chapter-regex="lrfchapter" --chapter-attr="div,class,lrfchapter"

This will show up in the table of content as :
CHAPTER X On the road again
sahlberg is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No table of content in pdb ereader Jonimeesermann Calibre 0 05-21-2010 05:10 PM
text file and table of content skao Calibre 1 04-09-2010 12:15 PM
kindle DX table of content inactive Maupassant Amazon Kindle 1 02-06-2010 10:44 AM
Placement of Table of Content AFTER Dedication? micfranxon Kindle Formats 1 01-19-2010 04:37 AM
Table Of Content tomcool420 Sony Reader Dev Corner 3 03-16-2008 12:14 PM


All times are GMT -4. The time now is 11:35 PM.


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