I've got a string like this: aXYbXYc, and need to replace the XY substring with a right arrow: a $\to$ b $\to$ c.

Is there any function (also provided by external packages) to help me do that?

  • Like sed? E.g., sed 's/\([a-z]\)XY/\1 $\\to$ /g' myfile.tex... – jon Mar 30 '17 at 1:51




  • Please don't use minimal for examples. – cfr Mar 29 '17 at 22:43
  • What is the point in using \IfSubStr? – Solomon Ucko Jan 5 at 2:36
  • I cannot remember, so I must say it is without any sense ... – user2478 Jan 5 at 15:11

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.