Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-09-2011, 02:24 AM   #1
Vanguard3000
Groupie
Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.
 
Posts: 152
Karma: 474196
Join Date: Jan 2011
Location: Ottawa
Device: Kobo Aura H2O
Generating a rough "table of contents"

Currently, I'm using a Kobo for ereading, and as you all may know, there's no way to simply skip to a certain page. What this can mean is, with some epubs not formatted with a table of contents, getting through to where you left off on your hard copy of the book can mean tons and tons of page turns.

I was wondering if there was a way for Calibre, while converting an epub, to make up a table of contents by simply breaking up the file into a user-specific number of sections (say, ten), and marking those as "chapters" on the ToC. That way, the reader could at least fast-forward to the 70%-mark of the book, and find their place from there.

Calibre seems to have several ToC options available in the conversion menu, but none of them seem to work for me, and I don't seem to be seeing my answer in the help pages.

Thanks in advance for any help.
Vanguard3000 is offline   Reply With Quote
Old 01-09-2011, 06:40 AM   #2
Dopedangel
Wizard
Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.
 
Dopedangel's Avatar
 
Posts: 1,759
Karma: 30063305
Join Date: Dec 2006
Location: Singapore
Device: Boyue
I dont think thats possible

What are your source files for generating epubs
normally calibre just checks H1 and H2 tags but most books I acquire use H3 for chapter heading so I use this for chapter detection

Quote:
//*[((name()='h1' or name()='h2' or name()='h3') and re:test(., 'chapter|book|section|part\s+', 'i')) or @class = 'chapter']
and this for page breaks before every chapter

Quote:
//*[name()='h1' or name()='h2' or name()='h3']
If chapters are still not detected I try to use notepad++ to add <h3> tags to the source files and use this in level 1 Toc as a last option never fails
Quote:
//h:h3
Dopedangel is offline   Reply With Quote
Advert
Old 01-09-2011, 09:59 PM   #3
Vanguard3000
Groupie
Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.Vanguard3000 ought to be getting tired of karma fortunes by now.
 
Posts: 152
Karma: 474196
Join Date: Jan 2011
Location: Ottawa
Device: Kobo Aura H2O
So far, I've been adding in <h1/2/3> tags manually, but it gets quite tedious. The ones I dread specifically are Frank Herbert's Dune books. First off, they're very long books, with lots of chapters; and they don't have normal chapter headings (and therefore, no <h> tags already in the epub file).

So, I'm pretty much stuck putting them in myself, then?
Vanguard3000 is offline   Reply With Quote
Old 01-09-2011, 10:26 PM   #4
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
Try enabling the preprocess option under structure detection - one of the things it does is tries to detect common chapter headings and wrap them in <h2> tags so you don't have to. It's not always going to work, and can stick headings where you don't want them in rare cases, but generally should do ok.

If your book already has heading tags then that feature won't help you, you just need to look at the html to see what the right xpath needs to be.

You can make the default xpath match a lot more if you change it to this:
Code:
/*[((name()='h1' or name()='h2' or name()='h3') and re:test(., '.*', 'i')) or @class = 'chapter']
That may match too much, but if you're looking for a way to get more reliable 'rough' tocs that could help.

Last edited by ldolse; 01-09-2011 at 10:29 PM.
ldolse is offline   Reply With Quote
Old 01-09-2011, 10:26 PM   #5
Dopedangel
Wizard
Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.
 
Dopedangel's Avatar
 
Posts: 1,759
Karma: 30063305
Join Date: Dec 2006
Location: Singapore
Device: Boyue
Quote:
Originally Posted by Vanguard3000 View Post
So far, I've been adding in <h1/2/3> tags manually, but it gets quite tedious. The ones I dread specifically are Frank Herbert's Dune books. First off, they're very long books, with lots of chapters; and they don't have normal chapter headings (and therefore, no <h> tags already in the epub file).

So, I'm pretty much stuck putting them in myself, then?
depends upon the headings let say the heading are all caps you can make a regex that would set all full Cap words as headings but I am not good at regex but there are others here who would be able to help.
Dopedangel is offline   Reply With Quote
Advert
Old 01-09-2011, 10:31 PM   #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
Quote:
Originally Posted by Dopedangel View Post
set all full Cap words as headings but I am not good at regex but there are others here who would be able to help.
This, as an example is one of the things the preprocess option will do.
ldolse is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Format of "Contents" section in metadata IMFletch Calibre 2 12-24-2010 12:04 AM
Table of Contents not generating Amalthia Calibre 2 12-19-2010 08:15 PM
Woher bekomme ich "Infinite Jest" oder "Unendlicher Spaß" von David Foster Wallace? bitschnau Erste Hilfe 3 11-01-2010 01:22 PM
how does the kobo make it's "table of contents" soup Kobo Reader 5 08-17-2010 10:24 PM
TOO SLOW to open "Table of Contents" mdhuang Sony Reader 16 09-06-2007 10:29 PM


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


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