Copy link to clipboard
Copied
Hello,
may anyone help to convert X^(2-x)(4-x) + 18y to the part after ^ in superscript (only this part: "^(2-x)(4/6) " before +)?
Copy link to clipboard
Copied
I believe the only way to apply superscript would be by using a Character Style; that is, use GREP to select the superscript string and apply the style.
It may be difficult to write a GREP string that can distinguish the end of a complex string like that, though, unless there is some kind of consistent marker, separator or terminator, or the strings are consistent in format.
Copy link to clipboard
Copied
Hi @Eunice36085839l2u9, this is one of those questions that is easy to answer correctly, but the answer probably won't help you, because your example cannot capture the actuality.
But here's the easy answer, and maybe it will help.
\^\S+
If you put this into a grep style to trigger a "superscript" character style you will get this:
It simply makes everything superscript from the caret (^) onwards and stops before a space.
Do you want the caret removed? Probably. But if you do, the grep style won't work. But you could hide it like this:
Edit: I added a demo .indd file so you can look at this and type some formulas to test.
Or maybe you could use the greps I specified to do a Find/Change Grep to set a character style. That way you'd more-easily be able to override any false superscripts that occurred.
Another approach would be to look around for any online equation editors that could export as svg. I think there are some, but I don't know them off hand.
- Mark
Copy link to clipboard
Copied
That works except where if somewhere there was no space before the plus (4/6)+ the plus is found
Copy link to clipboard
Copied
Yep. If this method is to work, then probably some spaces would need to be added manually. Note that, for presentation purposes, they could zero-width or thin spaces.
Copy link to clipboard
Copied
Muito obrigado!!! testei aqui e funcionou, você ajudou bastante. 8)✌️
Copy link to clipboard
Copied
Great to hear! 8)
Copy link to clipboard
Copied
You say after ^ but then say only this part "^(2-x)(4/6)" before +
where ^ is part of what you want to find after?
Do you want to include the ^ or not?
Anyway if you want to include it
(?<=\^)(\(.*?\)\(.*?\))(?= *\+)
If you don't
\^(\(.*?\)\(.*?\))(?= *\+)