I currently have a problem when editing my manuscript.tex files. So far I have always used the text short-hand $$; however, something comes up and it requires me to replace all $…$ by \( \).
I think “sed” with replacement operation should be a right tool for the task. However, I am not good or familiar with “sed” and regular expression. Therefore, I need hints and helps for doing this.
Supposed the input file is named as manuscript.tex. I need “sed” to replace $ e=mc^2 $ with \( e=mc^2 \). How can I do this ?
If there is never a newline between the dollar signs, you can try something like