Category Archives: LaTeX

Regular expression for LaTeX

To change dollar signs into backslash followed by parenthesis, search for

\$(.*?)\$

and replace by

\\($1\\)

So for example

$x^2$

becomes

\(x^2\)

To change double dollars signs into the preferable form, search for

\$\$(.*?)\$\$

and replace by

\\[$1\\]

Hannes Diener points out that this does not work for dollar signs that are nested within \text or \mbox environments.

Another good one is:
Search for

([a-z]*)

Replace by

$1,$1@hawaii.edu

Another one is:

\|(.*?)\\\|

replace by

norm{$1}