[OS X TeX] math replace
herbs at wideopenwest.com
Thu Jun 27 23:48:12 CEST 2013
On Jun 27, 2013, at 4:13 PM, Michael Sharpe <msharpe at ucsd.edu> wrote:
> On Jun 27, 2013, at 7:12 AM, George Gratzer <gratzer at me.com> wrote:
>> I would like to replace a large number of i-s to k-s in math.
>> Is there any intelligent way to do it?
> I'm not sure there is a sure-fire way to do this because there are so many things that can go wrong with any simple algorithm. I made a few small modifications to my dedollar python script so that it will find all i contained in math delimited by either $...$ or $$...$$ and replace by k as long as they are not part of a control sequence. You are probably best off handling other display math environments manually, as you could end up modifying environment names and text embedded within the displays on a wholesale basis.
> The script is named mathsubki, located on my site:
> Place it in a the same folder as your tex file. Then open a Terminal window, cd to that folder and type, assuming you file is named xx.tex,
> ./mathsubki xx.tex
> which should make a file named
> with the substitutions. I haven't tested this extensively, of course, but is does not write to your original file and cannot damage it.
I was pretty sure it would require the use of a program/filter rather than a regex.
I'd guess that there are lots of align and align* environments, etc., which would complicate matters even more. But George hasn't said anything.
(herbs at wideopenwest dot com)
More information about the macostex-archives