06-25-2012, 02:51 PM | #1 |
Addict
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
|
Can't add chapter markers to MOBI file
I used MobiUnpack and opened the HTML file.
It seems the chapters look like this: <mbp: pagebreak></mbp: pagebreak><blockquote height="3em"><blockquote width="0pt" align="center"><font size="5">CHAPTER 1</font> </blockquote></blockquote> I tried using Structure Detection and set it to "blockquote" as the tag, "height" as the attribute and "3em" as the value, no luck. I tried heuristic processing and ticked "Detect and markup unformatted chapter headings and sub headings", no luck. I tried setting Table of Contents Level 1 TOC to: //h:blockquote[re:test(@height, "3em", "i")] No luck. Any ideas? |
06-25-2012, 03:16 PM | #2 |
Grand Sorcerer
Posts: 27,871
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I probably wouldn't recommend using the output of MobiUnpack as verbatim structure detection criteria for calibre conversions. Give calibre a folder to dump its debug output to (the debug section of the convert settings) and use the html you find there (but probably not the "debug-raw" html) for your structure detection criteria.
|
Advert | |
|
06-25-2012, 03:56 PM | #3 |
Addict
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
|
Ok, tried that, now it seems the chapters are defined by:
<div class="mbp_pagebreak"/><blockquote class="calibre_24"><blockquote class="calibre_25"><font size="5">CHAPTER 1</font> </blockquote></blockquote> But I've tried setting Structure Detection to "div", "class" and "mbp_pagebreak" as well as "blockquote", "class" and "calibre_24", still no luck. I also tried just leaving tag as * and attribute blank, and value as "calibre_24" (also tried "calibre_25", still nothing |
06-25-2012, 04:27 PM | #4 |
Grand Sorcerer
Posts: 27,871
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Will <blockquote class="calibre_25"><font size="5"> uniquely isolate all (and only) the chapters headings? You really need to find something that drills right down to the actual chapter heading text (in this case "CHAPTER 1"). You seem to be stopping just shy of that.
You may be beyond what the "Wizard" XPath expression builder can create automatically for you. Check out that XPath tutorial link that can be found on the Wizard dialog. It will help if you need to craft more complex expressions by hand. Perhaps something like: Code:
//h:blockquote/h:font[re:test(., 'chapter', 'i')] EDIT: also check some of the HTML in the various conversion stages (sub-folders) inside that debug folder if you can't get that expression to work. I'm not entirely sure at which stage of the conversion that XPath expression search will take place. And you may need to check the "Force use of auto-generated Table of Contents" checkbox, also. Last edited by DiapDealer; 06-25-2012 at 06:16 PM. Reason: typo |
06-25-2012, 06:21 PM | #5 | |
reader
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
Quote:
Code:
//*[re:test(., 'CHAPTER ')] Code:
//*[re:test(., '^CHAPTER [1-9]')] |
|
Advert | |
|
06-26-2012, 05:07 AM | #6 | |
Addict
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
|
Quote:
Chapter 1 Chapter 1 Chapter 1 Chapter 2 Chapter 2 Chapter 2 etc... |
|
06-26-2012, 05:48 AM | #7 |
Addict
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
|
I got it to work with:
Code:
//h:blockquote/h:font[re:test(., 'CHAPTER', 'i')] but it doesn't actually add chapter markers to the book, it just creates a correct TOC EDIT: actually I think it's working, I was using Kindle Previewer to check it and I don't think I was scrolled all the way to the bottom where the chapter markers are displayed! Last edited by gers1978; 06-26-2012 at 05:55 AM. |
06-26-2012, 08:27 AM | #8 | |
Grand Sorcerer
Posts: 27,871
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
But yes, the entire emulated Kindle "screen" of the Kindle Previewer doesn't fit on my monitor either, so you will have to scroll down to see the progress bar with the chapter markers on it. |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chapter Markers in Kindle | Chopman | Conversion | 5 | 04-26-2012 04:52 PM |
Add to chapter marks to mobi file? | neonbible | Amazon Kindle | 7 | 04-12-2011 03:04 PM |
Converting EPUB to MOBI - missing chapter markers | peartree | Amazon Kindle | 10 | 04-01-2011 06:02 PM |
Chapter Markers? | djulian | Calibre | 3 | 11-20-2010 11:15 PM |
PRC with no chapter marks. Best way add them and convert for Kindle mobi? | neonbible | Calibre | 0 | 10-19-2010 08:01 AM |