1 person found this helpful
Apply a character style tot he first three letters of the paragraph (use a nested style, and the definition can be nothing but a name, no attributes at all), thenuse a Running Header (Character Style) variable. That will only get you Aar - Adv, though.
The only way to get a variable number of characters would be to apply the character style to a varialbe number of characters at the start of the paragraph, and that is going to require manual intervention, either to apply the style, or to set an "end nested style here" character and use that for the trigger instead of an number of characters. Of course you might want to do that anyway, if you 1- or 2- character words to index.
Hello Peter. Thanks for this solution. I have considered using a character style variable, however, I will be using the running header text variable on a master page, and using a data merge to fill in ~100's of pages with data, making the application of a character style very time consuming, and prone to requiring a change if there are edits needed on the data.
Check out In-Tools Power Headers. I believe you can add a GREP
expression to your headers, and that would be your answer.
That's not going to work. It would require defining two custom variable per page, and in that case you'd better make the script fill in the right word fragments straight away.
Peter's suggestion of adding End Nested Style sounds like a good one -- at least that can be scripted, and you can still use variables for your headers. But I'm wondering about
Aard - Adv
-- what is the idea behind four letters for the first, three letters for the second entry? Should that *always* be the case, or would your hypothetical script cut off words right after a sequence of two consonants?