I have indesign CS5 and I'm working on a document that has math examples throughout such as 9-1=8. The proofreader said we need to change it to have a space between each digit and math symbol to be 9 - 1 = 8. How can I do this? When I go to Find/Change I have the option of wildcards in the Find, but not in the Replace.
Also the dash in these equations need to be changed to en dashes. How can I tell indesign that anytime is sees such an equation the dash needs to be changed? I don't want to just change all dashes as I have many dashes that need to stay.
I do it in two steps, first changing the hyphens to en-dashes:
Find (?<=\d)-(?=\d) which finds any hypen between two digits
Replace ~= which is the en-dash
Then use a class to hold the math symbols:
Find (\d|\))([\+\*/~==])(\d|\() (this adds open and close parentheses to the search before or after a symbol -- if your equations don't use parentheses you can eliminate the |\( and |\) from the first and last search groups)
Replace $1 $2 $3 (there's a space between the terms there).
This does not include radicals, or advanced math symbols in the search, so if your equations use those, you need to add them, and it doesn't put spaces between digits and parentheses.
Forgot to mention that the first query that changes the hypens to en-dashes will change them everywhere they appear between two digits, so you run the risk of changing things besides your equatuions, like some date or phone number formats, unless you restrict the search scope.
Also, there is no provision for negative numbers in any of what I posted.
I'm doing this for each chapter individually, and each chapter only uses one math symbol. You're right, if they would all be in one document I would have a problem. I guess your reply addressed that issue, but it just looked so complicated , and I don't know grep very well so for now I'm doing it chapter by chapter.
Looks more complex that it is, really. You can just copy the query out of the forum and paste it into the dialog, and Jongware did a wonderful "what the grep" script http://forums.adobe.com/message/2698510
Europe, Middle East and Africa