![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
How to put chapter title in two places in the index
I have a simple book that uses the normal <h1> tags for the chapter titles. I marked the chapter title text for the index and it shows up in the index fine.
Now I want to put the same chapter into the index using a different entry. Since the chapter title is already marked for the index once, I tried adding a search to the Index Editor where the "Text to include" is the text in the chapter title, and the "Index entry" is the new keyword I would like to add to the index. The new entry does not appear in the index. Does the index code not search in the <h1> tags? I marked some text in the first paragraph for the index and my new index entry keywoid, and that works, but when I click on the index entry, the reader (FBReader) puts that text at the top of the screen, leaving out the chapter title. Is there an easy way for me to add a chapter title to the index in more than one place? Thanks. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
The TOC provides a sequential list of chapter titles. The index provides an alphabetical list of chapter titles. It seems to me that might be useful for a book that is not intended to be read sequentially end to end.
The reason for multiple entries is that I want to group some similar chapters with slightly different titles under the same index entry as well as having their own entries. It isn't a big deal if it can't be done. I was curious whether I could do this or not and whether I am just not understanding the tool. |
![]() |
![]() |
![]() |
#4 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,736
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
OK. I must be missing something. The links in the index are calculated by Sigil when I create the index. How do I put a link in the index myself?
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,759
Karma: 5706256
Join Date: Nov 2009
Device: many
|
Have you tried putting an id on the h1 tag but then wrapping just the contents of the h1 tag in a span and giving that span a different id.
Alternatively right beside the h1 tag you could create a second h1 tag with duplicate contents but set it to display:none and use it for the target of the second index link. Just throwing out ideas here. |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
To see how it works, create a blank epub2 book, replace the <body> section of Section0001.xhtml with the following code and generate the index. Spoiler:
This should generate an index with 4 entries two of which are actually linking to the same targets. |
|
![]() |
![]() |
![]() |
#8 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,736
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
<p class="index"><a href="chapter1.html">Chapter 1</a></p> |
|
![]() |
![]() |
![]() |
#9 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,736
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#10 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,759
Karma: 5706256
Join Date: Nov 2009
Device: many
|
But only if it is to top of file. I have seen many Chapter Headings that actually came after some artwork, a phrase, a quote, or some other chapter preface material.
|
![]() |
![]() |
![]() |
#11 | ||
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
Quote:
I originally tried adding a paragraph with "visibility:hidden", but the text still showed up in one of the readers. Your suggestion seems to solve that. I am still confused about this suggestion: Quote:
|
||
![]() |
![]() |
![]() |
#12 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
I spoke too soon. The additional anchor text is invisible in the body of the book, but it shows up in the TOC.
|
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,759
Karma: 5706256
Join Date: Nov 2009
Device: many
|
Simply use the Edit TOC to remove the ones you do not want in the ToC
|
![]() |
![]() |
![]() |
#14 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
I think I figured out a way to do this.
Right before the <h1> heading I added the following code: Code:
<div style="display:none;" >Unique Text To Search For In Chapter 1</div> When I create the index, the code I put in changes to: Code:
<div style="display:none;" id="sigil_index_id_1">Unique Text To Search For In Chapter 1</div> I just need to make sure that the text I used is unique in the book so that it only finds one occurrence of it. This appears to work fine for the index, and the unique text does not appear in the book or in the TOC on my readers (FBReader and Ebook Viewer from Cabilbre). The key is using the style "display:none" to make the unique search text invisible. I have put the style into a class I call "DGInvisible". Then, I can simply add the code Code:
<div class="DGInvisible" >Unique Text To Search For In Chapter 1</div> Thanks to everyone for the suggestions. |
![]() |
![]() |
![]() |
#15 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
|
Quote:
Code:
<div class="sgc-toc-title">Table of Contents</div> <div class="sgc-toc-level-1"> <a href="Section0001.xhtml">Chapter 1Chapter 1</a> </div> <div class="sgc-toc-level-1"> <a href="Section0002.xhtml">Chapter 2 Chapter 2</a> </div> |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to put the Index in the TOC | Banjo | Sigil | 3 | 09-17-2018 10:18 PM |
Put Flightcrew PI in Index | BetterRed | Plugins | 1 | 12-16-2016 04:47 PM |
Plugboard "Metadata: Show series [series index] - title as title (Kindle)" | Deep Cover | Library Management | 6 | 11-30-2012 05:17 PM |
Feature request: Ability to put a book in a series without an index number | lunixer | Calibre | 6 | 08-29-2011 11:37 AM |
Can't extract article title in parse index | hiperlink | Recipes | 19 | 01-18-2011 11:00 AM |