
{"id":357,"date":"2013-03-10T09:28:36","date_gmt":"2013-03-10T19:28:36","guid":{"rendered":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/?p=357"},"modified":"2015-08-18T09:29:53","modified_gmt":"2015-08-18T19:29:53","slug":"regular-expression-for-latex","status":"publish","type":"post","link":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/regular-expression-for-latex\/","title":{"rendered":"Regular expression for LaTeX"},"content":{"rendered":"<p>To change dollar signs into backslash followed by parenthesis, search for<\/p>\n<pre>\r\n\\$(.*?)\\$\r\n<\/pre>\n<p>and replace by<\/p>\n<pre>\r\n\\\\($1\\\\)\r\n<\/pre>\n<p>So for example <\/p>\n<pre>$x^2$<\/pre>\n<p> becomes <\/p>\n<pre>\\(x^2\\)<\/pre>\n<p>To change double dollars signs into the preferable form, search for<\/p>\n<pre>\r\n\\$\\$(.*?)\\$\\$\r\n<\/pre>\n<p>and replace by<\/p>\n<pre>\r\n\\\\[$1\\\\]\r\n<\/pre>\n<p>Hannes Diener points out that this does not work for dollar signs that are nested within \\text or \\mbox environments.<\/p>\n<p>Another good one is:<br \/>\nSearch for<\/p>\n<pre>\r\n([a-z]*)\r\n<\/pre>\n<p>Replace by<\/p>\n<pre>\r\n$1,$1@hawaii.edu\r\n<\/pre>\n<p>Another one is:<\/p>\n<pre>\r\n\\|(.*?)\\\\\\|\r\n<\/pre>\n<p>replace by<\/p>\n<pre>\r\nnorm{$1}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/regular-expression-for-latex\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Regular expression for LaTeX<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-357","post","type-post","status-publish","format-standard","hentry","category-latex"],"_links":{"self":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/posts\/357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/comments?post=357"}],"version-history":[{"count":12,"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/posts\/357\/revisions"}],"predecessor-version":[{"id":9095626,"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/posts\/357\/revisions\/9095626"}],"wp:attachment":[{"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/media?parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/categories?post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/math.hawaii.edu\/wordpress\/bjoern\/wp-json\/wp\/v2\/tags?post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}