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 01-30-2011, 04:20 AM   #1
Paulinafrica
Zealot
Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.
 
Paulinafrica's Avatar
 
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
TOC & .ncx query

Hello, please forgive any idiocy on my part with my inability to successfully implement what I suspect is probably a straightforward 'structure detection' setting within calibre. In essence I have a book in epub format that I am converting to mobi, the original epub file does not have an ncx component, but does have a TOC, but when you go to the TOC editor in Sigil it is blank, if I convert it to mobi, all the chapter headings and TOC are there but without the navigation bar at the bottom of the kindle screen - obviously due to the lack of the ncx file - not a deal breaker I know, but I'd still like to have it.
The original code is as below:
Code:
 <body>
  <div class="chapter" id="ch11">
    <p class="chapterTitle"><a href="../Text/contents.html#ch_11">Chapter 11</a></p>
  </div>
I have then added this to produce the ncx
Code:
<body>
  <h2 id="heading_id_2">Chapter 11</h2>
  <div class="chapter" id="ch11">
    <p class="chapterTitle"><a href="../Text/contents.html#ch_11">Chapter 11</a></p>
  </div>
The problem is that when I convert to mobi through calibre I end up with one page showing Chapter xx and then the next page as the normal chapter break, so it's almost as if I have 2 sets of info when I only read need 1 - I now do have the all important ncx file of course and the navigation bar is functioning - what I want to know is how to instruct calibre not to create a page break for the added component i.e. h2
Apologies if this somewhat rambling in nature
Cheers Paul
Paulinafrica is offline   Reply With Quote
Old 01-30-2011, 04:59 AM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
The code you have seems to be showing the Chapter title twice - once inside the <h2> tag and the other inside the <p> tag within the <div>. If you are adding the <h2> tag I would think you could remove the <div> tag and it's contents.
itimpi is offline   Reply With Quote
Advert
Old 01-30-2011, 05:06 AM   #3
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
You could change the XPath chapter detection to use your existing tag structure. Using this should do the trick:
Code:
//*[name()="div" and @class="chapter"]
Manichean is offline   Reply With Quote
Old 01-30-2011, 05:34 AM   #4
Paulinafrica
Zealot
Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.
 
Paulinafrica's Avatar
 
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
Quote:
Originally Posted by itimpi View Post
The code you have seems to be showing the Chapter title twice - once inside the <h2> tag and the other inside the <p> tag within the <div>. If you are adding the <h2> tag I would think you could remove the <div> tag and it's contents.
I'm reluctant to move all the contents within the <div> tag as I believe there are elements within that, that are used to point to the Contents, but I could be wrong of course as h2 will more than likely create a TOC in any case, but this will be at the rear of the book as opposed to where it is at the moment in the front, thanks for your input, but I'm going to try the suggestion from Manichean first as it may be more elegant and certainly a lot less work!
Cheers
Paul
Paulinafrica is offline   Reply With Quote
Old 01-30-2011, 05:43 AM   #5
Paulinafrica
Zealot
Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.
 
Paulinafrica's Avatar
 
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
Quote:
Originally Posted by Manichean View Post
You could change the XPath chapter detection to use your existing tag structure. Using this should do the trick:
Code:
//*[name()="div" and @class="chapter"]
Unfortunately this didn't seem to work at the first attempt, but there are a number of places to insert XPath code; I have placed your suggestion under Structure Detection at 'Detect chapters at (XPath expression)', will it make a lot of difference if I put it elsewhere?
Cheers
Paul
Paulinafrica is offline   Reply With Quote
Advert
Old 01-30-2011, 05:53 AM   #6
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I think you'd need to put it in the Level 1 TOC in the table of contents tab, as well. Also, you'd probably need to set Calibre to force use of the autogenerated TOC.
Manichean is offline   Reply With Quote
Old 01-30-2011, 06:44 AM   #7
Paulinafrica
Zealot
Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.
 
Paulinafrica's Avatar
 
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
Quote:
Originally Posted by Manichean View Post
I think you'd need to put it in the Level 1 TOC in the table of contents tab, as well. Also, you'd probably need to set Calibre to force use of the autogenerated TOC.
I've tried all your suggestions but to no avail, thanks for your time , I'm not going to give up just yet though, I will persevere.
Cheers
Paul
Paulinafrica is offline   Reply With Quote
Old 01-30-2011, 09:37 AM   #8
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by Paulinafrica View Post
I'm reluctant to move all the contents within the <div> tag as I believe there are elements within that, that are used to point to the Contents, but I could be wrong of course as h2 will more than likely create a TOC in any case, but this will be at the rear of the book as opposed to where it is at the moment in the front, thanks for your input, but I'm going to try the suggestion from Manichean first as it may be more elegant and certainly a lot less work!
Cheers
Paul
You could try changing the <p> tag inside the <div> tag to be a <h2> one (do not forget to change the closing tag as well) rather than adding a new line.
itimpi is offline   Reply With Quote
Old 01-30-2011, 11:14 AM   #9
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
you could also avoid using a style-name the is a standard splitting filter

change the stylesheet and usage from .chapter (class="chapter", to something that the splitter won't grab upon.

style-sheet: .mychapt
usage: class="mychapt"

But changing the original (in red)p to h2 should have done the trick so for BOTH the TOC and inline_toc

Code:
 <body>
  <div class="chapter" id="ch11">
    <p class="chapterTitle"><a href="../Text/contents.html#ch_11">Chapter 11</a></p>
  </div>
theducks is offline   Reply With Quote
Old 01-31-2011, 12:41 PM   #10
Paulinafrica
Zealot
Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.Paulinafrica can successfully navigate the Paris bus system.
 
Paulinafrica's Avatar
 
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
Quote:
Originally Posted by itimpi View Post
You could try changing the <p> tag inside the <div> tag to be a <h2> one (do not forget to change the closing tag as well) rather than adding a new line.
OK, thanks itimpi, that's the answer and also theducks for his visual representation, which helped immensely, both of you have been a great help, I suspect that I probably need a bit of html 101 .

I was also battling in trying to centre the chapter heading and after a lot of messing around with the html code and finding advice through my trusty friend google, I wasn't getting much success, until I had a brainwave and simply centred it using the text editor in Sigil, hey presto

Code:
<body>
  <div class="chapter" id="ch06">
    <h2 class="chapterTitle sgc-1 sgc-2" id="heading_id_2"><a href="../Text/contents.html#ch_06">Chapter 6</a></h2>
  </div>
I still don't know what sgc-x (sigil proprietary code?) is all about and I certainly didn't come across that on the Internet but it works.
Cheers
Paul
Paulinafrica is offline   Reply With Quote
Old 01-31-2011, 09:21 PM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Paulinafrica View Post
OK, thanks itimpi, that's the answer and also theducks for his visual representation, which helped immensely, both of you have been a great help, I suspect that I probably need a bit of html 101 .

I was also battling in trying to centre the chapter heading and after a lot of messing around with the html code and finding advice through my trusty friend google, I wasn't getting much success, until I had a brainwave and simply centred it using the text editor in Sigil, hey presto

Code:
<body>
  <div class="chapter" id="ch06">
    <h2 class="chapterTitle sgc-1 sgc-2" id="heading_id_2"><a href="../Text/contents.html#ch_06">Chapter 6</a></h2>
  </div>
I still don't know what sgc-x (sigil proprietary code?) is all about and I certainly didn't come across that on the Internet but it works.
Cheers
Paul
SGC (style) codes are inserted BEFORE the <body> start
They are mainly inserted when you use the Justification or Font buttons in Sigil If you ONLY style you document using the stylesheet and Code View (and don't use the buttons), SGC codes don't get inserted. There are exceptions: (I just have not figgured out what triggers Auto-SGC codeing)
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Mapping Using toc.ncx lorddon ePub 35 01-16-2018 12:18 PM
NCX From Html TOC Unno Kindle Formats 20 09-16-2011 09:31 AM
Syntax for toc.ncx Levels 1 and 2? NewDay ePub 7 04-04-2011 04:09 PM
Saving with old toc.ncx file Haderlump Sigil 1 12-28-2010 12:11 PM
Can you bypass first two items in TOC.ncx? sueneu Kindle Formats 4 07-14-2010 08:36 AM


All times are GMT -4. The time now is 06:44 AM.


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