/ Id-Extras Forum / LiveIndex character style issue

  • Author
  • #6156 Reply

    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?

    #6261 Reply
    Ariel
    Keymaster

    Hi Marco,
    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.
    Thanks,
    Ariel

    #6262 Reply

    Hi Ariel,

    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. “.

    Cheers

    #6263 Reply
    Ariel
    Keymaster

    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.

    #6264 Reply

    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!

    #6265 Reply
    Ariel
    Keymaster

    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.

    #6266 Reply

    Yes, I thought too it would be the best idea.

    No rush, but happy to help if you need anything!

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: LiveIndex character style issue
Your information: