summaryrefslogtreecommitdiff
path: root/support/easylatex/wikiLatexToEasyLatex.pl
blob: c60ca6056511d6afe11bc251c9b5c2cef6b1412c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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!