![]() |
#1 |
Member
![]() Posts: 19
Karma: 10
Join Date: Feb 2010
Location: Colorado, US
Device: Kindle 3
|
TOC based on Capitalized Words
I have a book which isn't well formatted to created a TOC. The only format clue is that all letters of the first couple of words of the chapter are CAPs. Is there any formula that can create a TOC from this.
Thanks |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
you can quickly step through (just Find-next or Replace) change the pattern to match those skipped: repeat BTW: if the Chapter start uses 'small-caps' a case sensitive S&R will not work, but the small-caps class is your best ever trigger ![]() Assuming ![]() If a chapter also starts mid-file, ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
You could do the same thing in the Calibre conversion process, I believe- you can use regex in XPath, so you'd have to formulate an expression that matches capitalized words.
Another thing to try would be to activate the relevant heuristic options. |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
If I understand the use case he's describing it's not one currently covered by Heuristics. That said, next time I get back to tweaking that it's a potential test case to add, but one that works pretty differently from the existing function as you wouldn't want to wrap those lines in H2 tags.
XPATH with Regex is about the only thing that would work, but all the TOC entries would then be a paragraph long. |
![]() |
![]() |
![]() |
#5 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,913
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
I have done a non-visible header inserted before the back referenced text is rebuilt. <h2 class="very short" title="\1"> <h2> < The original source preceeding Stuff>\1 |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
That's kind of how I was thinking I would do it for Heuristics too, still fiddly because lots of books that do have first paragraphs with that formatting have normal chapter headings anyway. That fact could also help reduce false positives for some books though.
Last edited by ldolse; 06-03-2011 at 11:19 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ePub TOC to mobi TOC | edmnddntes | Conversion | 5 | 01-24-2011 02:56 AM |
Creating TOC for books based on Text Files | crich70 | Kindle Formats | 4 | 09-13-2010 12:47 AM |
Should ''internet'' be capitalized or lowercase? | taglines | Lounge | 18 | 07-06-2010 04:15 AM |
Detect chapter headings with capitalized words | fiendmish | Calibre | 6 | 05-31-2010 10:45 AM |
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working | Magitek | LRF | 0 | 05-06-2009 01:25 PM |