10-06-2018, 02:43 PM | #1 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Location: Reading, UK
Device: Kindle 3 3G
|
Creating a ToC in a Kindle .AZW eBook that has none
My Kindle eBook has chapter headings like:
Chapter I - AT MAYTREE COTTAGE The equivalent HTML seems to be : <p class="calibre_12"><font size="4"><span class="bold">Chapter I</span></font></p><p class="calibre_12">- AT MAYTREE COTTAGE</p> How would I create a ToC like: Chapter I - AT MAYTREE COTTAGE using the Convert Books ToC function? I can already create the ToC just with: Chapter I with the ToC function by just leaving its XPath Expressions as the default blank. |
10-06-2018, 03:22 PM | #2 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
I use the TOC tool in the Editor (or main Calibre toolbar )
But that is some ugly code ( Code:
<p class="calibre_12"><font size="4"><span class="bold">Chapter I</span></font></p><p class="calibre_12">- AT MAYTREE COTTAGE</p> font sizing should be done in the CSS. <h tags are bold by default First step is to 'pretty' the code using the flower icon (main toolbar) in the editor so any pattern match has a better chance Personally, I would code this as: Code:
<h3 class="chapno">Chapter I <br />- AT MAYTREE COTTAGE</h3> where .chapno in the CSS would control the style line-height: 2 ; spreads the lines further apart I think this EDITOR REGEX search may work. (Replace and Search, NEVER all) Find <p class="calibre_12"><font size="4"><span class="bold">(Chapter .+?)</span></font></p><p class="calibre_12">(- .+?)</p> Replace <h3 class="chapno">\1 <br />\2</h3> |
10-06-2018, 03:43 PM | #3 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Location: Reading, UK
Device: Kindle 3 3G
|
Thanks, but I didn't follow much of that. I a newbie in this. That code might be ugly but it's what's in the file. It's a given.
The Calibre editor works only on EPUB & AWZ3 files only. Are you suggesting I 1st convert my AWZ file to those & then search & replace the heading lines from 1 code to another? Is there no way to convert my file directly & combine the 2 heading lines into 1 in a ToC or even to have them as a 2 level ToC? |
10-06-2018, 07:39 PM | #4 | |
Well trained by Cats
Posts: 29,800
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:
AFAIK there is no way to convert-combine. The only things obvious I saw that makes that code a chapter title is the word Chapter and a font-size tag So, I would convert to AZW3 and then work on it. BTW here is a snippet of code I use to search for Roman numeral chapter numbers ( stand alone. you will need to add pieces to match your specific code) Code:
<p class="\w">([CLXVI]{1,7})</p> |
|
10-06-2018, 08:08 PM | #5 | |||
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Location: Reading, UK
Device: Kindle 3 3G
|
Quote:
Quote:
Quote:
If you're going to edit that file the simplest edit would be to merge the 2 heading lines into 1 & then the "Chapter # - Title" would come out in the wash in the ToC. Last edited by XRaySpeX; 10-06-2018 at 08:53 PM. |
|||
10-06-2018, 09:10 PM | #6 | |
Well trained by Cats
Posts: 29,800
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:
It also included making it an H tag, so the TOC tool (and it does need to be redone after the change) will find by Headers |
|
10-07-2018, 08:57 AM | #7 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Location: Reading, UK
Device: Kindle 3 3G
|
What exactly does <br /> do? I know <br> inserts a single line break. What's the difference?
|
10-07-2018, 10:02 AM | #8 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
10-10-2018, 08:44 PM | #9 |
Member
Posts: 19
Karma: 10
Join Date: Dec 2010
Location: Reading, UK
Device: Kindle 3 3G
|
I've given up on what I set out to do. From day 1 I was able to produce a full ToC with just the Chapter nos from my .AZW using the Calibre Converter with default settings. But after spending some days on this & trying everything I could see I got no futher forward. It's a crazy program!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to influence the ToC when creating an ebook | Skeeve | Calibre | 13 | 02-13-2015 12:52 PM |
Creating Hanging TOC for Kindle Menu | pypo | Editor | 17 | 07-15-2014 05:08 PM |
Creating kindle ebook without a TOC? | emerika | Kindle Formats | 0 | 03-04-2012 01:09 PM |
Creating Proper TOC in Kindle - regex help needed | lyric | Conversion | 1 | 10-17-2011 06:19 PM |
Seeing an AZW ebook on my Kindle without having to first upload it? | wornways | Amazon Kindle | 5 | 04-29-2011 12:46 AM |