summaryrefslogtreecommitdiff
path: root/support/easylatex/wikiLatexToEasyLatex.pl
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/easylatex/wikiLatexToEasyLatex.pl
Initial commit
Diffstat (limited to 'support/easylatex/wikiLatexToEasyLatex.pl')
-rwxr-xr-xsupport/easylatex/wikiLatexToEasyLatex.pl41
1 files changed, 41 insertions, 0 deletions
diff --git a/support/easylatex/wikiLatexToEasyLatex.pl b/support/easylatex/wikiLatexToEasyLatex.pl
new file mode 100755
index 0000000000..c60ca60565
--- /dev/null
+++ b/support/easylatex/wikiLatexToEasyLatex.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -pi
+
+s/(?<!\\)&/\\&/g;
+s/\$\$/\$/g;
+s/(?<!\\)%/\\%/g;
+s/(?<!\\)#/\\#/g;
+
+# those ops were idempotent
+
+s/'''(.*)'''/\\textbf{$1}/g;
+s/''(.*)''/\\emph{$1}/g;
+
+
+# add these to easylatex:
+
+s/^:(.*)/\n\\ \\ \\ \\ \\ $1\n\\\\\n/gm;
+s/<pre>/\\begin{verbatim}/g;
+s/<\/pre>/\\end{verbatim}/g;
+s/-->/\\to/g;
+#s/http:\/\/([\w\/\.]+)~([\w\/\.]*)/http:\/\/$1\\~{}$2/g;
+s/~/\\~{}/g;
+s/\\%(\s)/\\%\\ $1/sg;
+
+# change graph size in \{seminar} class! 3,3?
+s/\\begin{graph}/\\begin{graph}\nsize="3,3"/g;
+
+
+# alert! bug in easylatex ?!?: an escaped equals sign didn't take:
+
+#\ \ \ \ \ error rate \= 6\% (on \textbf{test} set)
+#
+# had to be manually changed to
+#
+#\ \ \ \ \ error rate $=$ 6\% (on \textbf{test} set)
+
+# note: must escape [s as \[s! must escape unwanted =s!
+
+
+
+
+