Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-23-2023, 03:38 PM   #1
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Multiple index entries pointing to the same location.

I am creating a book in which I have a need to create multiple index entries that all point to the exact same location in the book.

I have attached a simple example file to demonstrate my conundrum. It only has a title and three paragraphs of "Lorem ipsum" in it. There are two index entries.

What I would like to figure out is how to add additional index entries that point to the Title, for example "My book title". Hence the two index entries in the book.

I have tried adding a blank paragraph tag just before the title tag and pointing to that, but Sigill apparently does not want to do that. I have tried using a location in the first paragraph text for a second tag, but when I do that the title gets shifted up out of view when I follow the link in the index.

Textbooks do this sort of thing all the time, so I don't think that it is a totally crazy idea.

Is there a way in Sigil to create multiple index entries that all point to the same location?

I am suspecting that I am missing something simple.

Thanks for any ideas.

Banjo
(_)=='=~
Attached Files
File Type: epub MultipleIndexEntriesExample.epub (3.8 KB, 16 views)
Banjo is offline   Reply With Quote
Old 01-23-2023, 04:02 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
You are talking about an index, not a toc right?
KevinH is offline   Reply With Quote
Advert
Old 01-23-2023, 04:04 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
You can assign as many links as you want to the same location by linking to the same id in the target file.

How are you creating the index entries? Using a regex search or marking for index or ... ?
KevinH is offline   Reply With Quote
Old 01-23-2023, 06:36 PM   #4
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Quote:
Originally Posted by KevinH View Post
You can assign as many links as you want to the same location by linking to the same id in the target file.

How are you creating the index entries? Using a regex search or marking for index or ... ?
I am talking about the index, not the TOC.

I created the index by marking the tag contents for index with Tools => Index => Mark for Index and then clicking on the "Generate new index HTML file" button.

If i manually edit the Index.xhtml file to add another pointer to the sigil_index_id, it will get wiped out the next time I generate the index.

What am I missing?
Banjo is offline   Reply With Quote
Old 01-23-2023, 08:30 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
Not much. Index building is normally done only when the book text is complete.

So build your index once, then augment it as needed with as many additional links as you desire. The Index generator tool just automates as much of the process as possible.

Each index entry typically points to multiple references to a specific string. That is what the Index generator does by collecting the words you mark for it to include.

I will take a look at your example once I get back to an actual machine and not just an iPad that I have now.
KevinH is offline   Reply With Quote
Advert
Old 01-23-2023, 08:35 PM   #6
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
I looked around a bit, and I found in the user guide for 1.19.10 it says that when you mark text for entry:

Quote:
The text you enter as the name to use in the Index will be show up in the Index as follows:
[blank]: If you leave the name empty, then the exact words you highlighted will be used in the index.
words: If you enter a word or phrase, then that word or phrase will be used (e.g. Oak instead of oak).
heading/words: If you use a “/” in the name then a hierarchical group will be created (e.g. Forest/Tree/Oak will create an entry Oak filed under Tree filed under Forest).
entrya;entryb: If you use a “;” then multiple entries will be created for this word or phrase.
So I tried the "/", and it did make a hierarchical group. I tried the ";" and it simply put the literal string in the index.

Quote:
Title;My Other Title 1
Is this supposed to do what I want, and this is a bug?

BTW, I am running 1.9.10
Banjo is offline   Reply With Quote
Old 01-23-2023, 08:58 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
Here is the only way I could get it to do what I think you want. But I am no index expert as I rarely use this tool.

Code:
<h1><a class="sigil_index_marker" style="display: none;" title="My Title">My Title</a><a class="sigil_index_marker" title="Title">Title</a></h1>
When you run Tools->Index->Create Index it should do what you want.

Basically I had to insert an anchor around a new set of text and then style that anchor to not be displayed.

There may be other ways.

But in the end it may just be easier to edit the generated Index and under "My Title" put a link to the Title index entry under "See Title".
KevinH is offline   Reply With Quote
Old 01-23-2023, 09:12 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Banjo View Post
I tried the ";" and it simply put the literal string in the index.

Is this supposed to do what I want, and this is a bug?
Based on my reading of the User Guide, I think this is a bug too, but if so, it is one that has existed for a very very long time (I checked back to Sigil-1.0 and it does the same thing as current Sigil).

I will take a look at the code when I get some time this week to see when this was dropped and how it was supposed to work.
KevinH is offline   Reply With Quote
Old 01-23-2023, 09:23 PM   #9
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Kevin,
Thanks a bunch.
I'll try your solution and keep looking.
Banjo is offline   Reply With Quote
Old 01-23-2023, 09:44 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
The capability to use ";" for multiple index entries was intentionally removed way back in Sigil 0.71 in Feb of 2013 (so before my time).

https://github.com/Sigil-Ebook/Sigil...bc8313df0ba6e2

The comment to that change say it was removed to prevent invalid code generation.

My guess is they just forgot to remove it from the Sigil User's Guide.

I will make that change to the users guide since it was deliberately removed.
KevinH is offline   Reply With Quote
Old 01-23-2023, 10:07 PM   #11
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
Looking closer. That feature was only meant for adding entries to the "Index Editor" and *not* for use with "Mark for Index". They removed it since regular expressions patterns are now supported in the Index Editor which means it can be used to match a number of variations of a word or phrase making the ";" approach obsolete.

So not a bug, but the Sigil Users Guide does need to be updated.

The issue with your example epub is that the string "My Title" is no where in the document itself so it can not be found by a pattern.

So my trick of using display hidden, is probably the only way to force creation of a "My Title" entry in the Index using the "Mark for Index" approach.
KevinH is offline   Reply With Quote
Old 01-24-2023, 12:46 PM   #12
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Kevin,

Thanks for looking into that.

I tried the style="display: none;" method, and it did not work for me. It made the extra title invisible in the overview panel, but not in the book. Two readers on my system, Okular and FBReader, both showed the invisible title in the book.

I will see if I can figure out a creative (or manual) way around my issue. If I come up with a solution that is better than the one I have, I will post.
Banjo is offline   Reply With Quote
Old 01-24-2023, 01:41 PM   #13
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
Try adding visibility:hidden after the display:none.

If that does not properly hide it then your e-reader is broken.
KevinH is offline   Reply With Quote
Old 01-24-2023, 01:46 PM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 6,696
Karma: 4500780
Join Date: Nov 2009
Device: many
According to spec, display:none should prevent even the layout of the tag. Not sure about your e-readers if they are ignoring it.
KevinH is offline   Reply With Quote
Old 01-24-2023, 04:45 PM   #15
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Quote:
If that does not properly hide it then your e-reader is broken.
An interesting observation. The "visibility:hidden" did not help either.

I copied the very same ebook onto my tablet and it works fine.... no visible second title..... using FBReader... ostensibly the same program I am using on this desktop.

So I installed Calibre on the desktop, and it works fine in Calibre as well.

I guess something is definitely FUBAR with a couple of my readers.
Banjo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Empty entries in the index libre75 Sigil 2 06-19-2019 05:07 PM
Index not working for entries within <em> 1v4n0 Sigil 10 10-30-2017 10:53 AM
Error: Index has too many entries... Katsunami Conversion 6 10-12-2013 10:06 AM
Bug: entries with multiple formats trigger multiple conversions flinx1 Calibre 12 05-21-2010 07:23 AM


All times are GMT -4. The time now is 05:03 PM.


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