/ Id-Extras Forum / LiveIndex character style issue
October 25, 2020 at 5:58 pm #6156marcoParticipant
Thanks for your great script! We use it to much satisfaction.
The character style method to create hyperlinks works, until we must apply it to some text with another character style already in place. Obviously the GREP find/change will change the correct character style.
Any idea on how to solve this?October 25, 2020 at 6:40 pm #6261~~Ariel~~Participant
Glad to hear you find LiveIndex useful!
What I would do (as a workaround) is to temporarily replace the other character style with some text styling (e.g. underline, or a special swatch or something). Then you can apply the page-number style to all the numbers and run LiveIndex.
When you’ve finished with LiveIndex, replace the underline or swatch with your required character style again.
Does that make sense? Let me know if I’ve misunderstood something.
ArielOctober 28, 2020 at 8:47 am #6262marcoParticipant
I guess it could work, the problem though is that page references sometimes have a number of character styles on them: sometimes they are in italics, sometimes in bold. The only consistent trait is that they are all preceded with “pag. “.
CheersOctober 28, 2020 at 8:54 am #6263~~Ariel~~Participant
Hmm, I wonder if you could use a GREP style here. Add a GREP style to the paragraph style the index uses. This GREP style could be made to target the page numbers (by searching for any digits preceded by pag.) and apply a special character style to those numbers.
In LiveIndex, you could then target that character style.
I think that might work, but I haven’t tried it.October 28, 2020 at 3:34 pm #6264marcoParticipant
hmmm, there can be a lot of paragraph styles, I should add a GREP style to all of them, it’s impractical.
The point is that I’m not trying to target just the index, but all references in the whole book!October 28, 2020 at 4:05 pm #6265~~Ariel~~Participant
Ah, I see, I thought it was just an index.
So, apart from creating extra character styles (e.g. italics-pagenum, bold-pagenum) and applying these to the page numbers throughout the book appropriately, and then running LiveIndex multiple time for each such character style, I’m out of ideas.
The best solution, of course, would be an option in LiveIndex itself, say an option to find page numbers “Based on the current setup in the GREP find.”
I’ll add that to the feature request list but can’t guarantee when it will be ready.
If you would like a quote to add this feature urgently, send me an email.October 28, 2020 at 4:56 pm #6266marcoParticipant
Yes, I thought too it would be the best idea.
No rush, but happy to help if you need anything!