Reply To: Need GREP for superscript interchange

Home Page / Forums / General InDesign Topics (CLOSED) / Need GREP for superscript interchange / Reply To: Need GREP for superscript interchange

#113673
Peter Kahrel
Participant

Aha, ok. So if a period on the baseline is followed by a superscripted number, the period and the number need to be swapped. If that’s what you want, then that’s not possible just like that because in InDesign you can’t search for two items with different formatting. So if you search for (\.)(\d+) you can’t specify that the dot should be normal and the number in superscript. You can use a three-step approach for this: expose the superscript as a text tag, do the change, and revert the superscript code. As follows:

1. Find what: (\d+)
Change to: %sup%$1
Find format: position superscript
Change format: position normal

.12 is now changed to .%sup%12
You can use any text tag you like.

2. Find what: \.(%sup%\d+)
Change to: $1.
(Blank the Find format and Change format panels)

3. Find what: %sup%(\d+)
Change to: $1
Find format: leave blank
Change format: position superscript.

P.

This article was last modified on January 16, 2019

Comments (0)

Loading comments...