Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 06-25-2012, 02:51 PM   #1
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
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?
gers1978 is offline   Reply With Quote
Old 06-25-2012, 03:16 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
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.
DiapDealer is online now   Reply With Quote
Advert
Old 06-25-2012, 03:56 PM   #3
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
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
gers1978 is offline   Reply With Quote
Old 06-25-2012, 04:27 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
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')]
Which will match all font tags inside of blockquote tags whose contents contain the word "chapter".

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
DiapDealer is online now   Reply With Quote
Old 06-25-2012, 06:21 PM   #5
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
Quote:
Originally Posted by gers1978 View Post
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>
Try:

Code:
//*[re:test(., 'CHAPTER ')]
Note there is no ",'i'" because you want to match just all the capital letter case. If this gives false positives, you can add that CHAPTER is start of an element, "^", and the chapter number, perhaps:

Code:
//*[re:test(., '^CHAPTER [1-9]')]
wallcraft is offline   Reply With Quote
Advert
Old 06-26-2012, 05:07 AM   #6
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
Posts: 392
Karma: 1008414
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by wallcraft View Post
If this gives false positives, you can add that CHAPTER is start of an element, "^", and the chapter number, perhaps:

Code:
//*[re:test(., '^CHAPTER [1-9]')]
This worked great, except for 1 thing - all chapters appear in the TOC 3 times! Like this:

Chapter 1
Chapter 1
Chapter 1
Chapter 2
Chapter 2
Chapter 2

etc...
gers1978 is offline   Reply With Quote
Old 06-26-2012, 05:48 AM   #7
gers1978
Addict
gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.gers1978 ought to be getting tired of karma fortunes by now.
 
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')]
in "Structure Detection > Detect Chapters at"

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.
gers1978 is offline   Reply With Quote
Old 06-26-2012, 08:27 AM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
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!
If you can click on the "NCX View" button in Kindle Previewer and see the correct list of chapters (and double click on them to go to that point in the book) then the chapter markers are there.

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.
DiapDealer is online now   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 11:20 AM.


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