Take the 2-minute tour ×  Does anyone have an example for a
search & replace lua script that I can use with TeXworks. I have
a rather large document here (about 3'000 pages DIN A5) which I
need to update continously. To change $to \$ and various other
replacements I would like to run a 'replace-all' script which
makes all the replacements in a single run.  This could be quite
useful when one has to take text from e.g. MS Word or the WWW.
share|improve this question Would you be interested in a sed or
perl solution? –  cmhughes Nov 28 '12 at 16:45 Nope, I would
like to have one in Texworks' lua scripting. –  Uwe Ziegenhagen
Nov 28 '12 at 17:13 There is a menu item to do this with
TeXworks from Search/Replace. However, I would advise you to
quit TeXworks, restart, and open a new blank document to test
this with first. Trying it with v4.4 on Mac hangs Texworks, and
had to Force Quit to get out of this loop. –  Peter Grill Nov 28
'12 at 18:21 @PeterGrill I know the menu command but there are
various replacements