-
Notifications
You must be signed in to change notification settings - Fork 2
/
prep.sed
60 lines (53 loc) · 3.87 KB
/
prep.sed
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/%begin-noprep/,/%end-noprep/!{
/l\**\o\|W\**\|l<[SZPT]..>\|[yzn]\**o<[RAOSZGP]..>\|nE<ATN>kA<RAF>\|<YET>[yrd]\**[Ea]\|q.n\**E<ATN>kA<RAF>\|n\**[EAe]<ATN>k\|n\**a<[MTA]..>k\|[slyx][EAae]<[MTA]..>[pk]\|[slyx][EAae]<[MTA]..><CIR>[pk]\|[nl][Aeau]<[TM]..>n\|p[eau]<MUN><RAF>p<RAF>$/ {
# p[eau]<MUN><RAF>p<RAF>$
/p[eau]<MUN><RAF>p<RAF>$/{
s/\(.*p\)\([ea]\)<MUN><RAF>p<RAF>$/\\mbox{<H>\1<RAF><NIL><\/H>\\hspace{-2mm}<H>\2<MUN><\/H>\\hspace{0.0mm}<H>p<RAF><\/H>}/
s/\(.*\)pu<MUN><RAF>p<RAF>$/\\mbox{<H>\1p<RAF><NIL><\/H>\\hspace{-2.3mm}<H>u<MUN><\/H>\\hspace{0.0mm}<H>p<RAF><\/H>}/
}
# lo or l*o in the text
/l\**o/ {
/^\\fn/s/\(l\**\)o/\1<\/H>\\hspace*{2pt}<H>o<\/H>\\hspace*{-2pt}<H>/g
s/\(.*l\**\)o\(<...>\)\(.*\)/\\mbox{<H>\1\2<\/H>\\hspace{1.6pt}<H>o<\/H>\\hspace{-1.6pt}<H>\3<\/H>}/g
s/\(.*l\**\)o\(.*\)/\\mbox{<H>\1<\/H>\\hspace*{1.6pt}<H>o<\/H>\\hspace*{-1.6pt}<H>\2<\/H>}/
}
/W\**o/ {
# Wo or W*o in the footnote
/^\\fn/s/\(W\**\)o/\1<\/H>\\hspace*{2pt}<H>o<\/H>\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n\**a<[MTA]..>k/ {
/<YET>[yrd]/s/<YET>\([yrd]\**\)\([Ea].*\)/\\mbox{<H><YET><NIL><\/H>\\kern1pt<H>\1\2<\/H>}/
/q.n/s/\(.*q.n\**\)E<ATN>kA<RAF>/\\mbox{<H>\1<NIL><\/H>\\kern-6pt<H><NIL>E<ATN><\/H>\\kern-1pt<H>kA<RAF><\/H>}/
/n\**[EAe]/s/\(.*n\**\)\([EAe]\)<ATN>\(k.*\)/\\mbox{<H>\1<NIL><\/H>\\kern-6pt<H><NIL>\2<ATN><\/H>\\kern-0pt<H>\3<\/H>}/
/n\**a/s/\(.*n\**\)a<\(MUN\|TIP\|MER\|ATN\)>\(k.*\)/\\mbox{<H>\1<NIL><\/H>\\kern-5pt<H><NIL>a<\2><\/H>\\kern-0pt<H>\3<\/H>}/
}
/[slyx][EAae]<[MTA]..>[pk]\|[slyx][EAae]<[MTA]..><CIR>[pk]\|[nl][Aeau]<[TM]..>n/ {
s/^\\fn{\(.*[ly]\)\([EAe]\)<ATN>\(k.*\)/\\fn{\1<\/H>\\kern-8pt<H><NIL>\2<ATN><\/H>\\kern-0pt<H>\3/
/[slyx][EAae]/{
s/\(.*[ly]\)\([EAe]\)<ATN>k"<RAF>$/\\mbox{<H>\1<\/H>\\kern-7pt<H><NIL>\2<ATN><\/H>\\kern-0pt<H>k"<RAF><\/H>}/
s/\(.*[ly]\)\([EAe]\)<ATN>kA<RAF>$/\\mbox{<H>\1<\/H>\\kern-7pt<H><NIL>\2<ATN><\/H>\\kern-0pt<H>kA<RAF><\/H>}/
/^\\fn{/s/\(.*l\)\([EAe]\)<\(MER\|TIP\|MUN\)>\(k.*\)/\1<\/H>\\hspace*{-5pt}<H><NIL>\2<\3><\/H>\\hspace*{0pt}<H>\4/
s/\(.*[slx]\)\([EAae]\)<\(MER\|MEH\|TIP\|MUN\|ATN\|TEB\)>p<RAF>$/\\mbox{<H>\1<\/H>\\hspace*{-7pt}<H><NIL>\2<\3><\/H>\\hspace*{1pt}<H>p<RAF><\/H>}/
s/\(.*[slx]\)\([EAae]\)<\(MER\|TIP\|MUN\|ATN\|TEB\)><CIR>p<RAF>$/\\mbox{<H>\1<\/H>\\hspace*{-7pt}<H><NIL>\2<\3><CIR><\/H>\\hspace*{1pt}<H>p<RAF><\/H>}/
/^\\fn{/s/\(.*l\)\([EAae]\)<\(MER\|TIP\|MUN\|ATN\|TEB\)>\(k\**["A].*\)/\1<\/H>\\hspace*{-5pt}<H><NIL>\2<\3><\/H>\\hspace*{0pt}<H>\4/
s/\(.*l\)\([EAae]\)<\(MER\|TIP\|MUN\|ATN\|TEB\)>\(k\**["A].*\)/\\mbox{<H>\1<\/H>\\hspace*{-5pt}<H><NIL>\2<\3><\/H>\\hspace*{0pt}<H>\4<\/H>}/
}
/[nl][Aeau]/{
s/\(.*[nl]\)\([Aeau]\)<\(TIP\|MER\|TEB\|MUN\|MEH\)>n$/\\mbox{<H>\1<NIL><\/H>\\kern-6pt<H><NIL>\2<\3><\/H>\\kern-0pt<H>n<\/H>}/
s/\(.*[nl]\)\([Aeau]\)<\(TIP\|MER\|TEB\|MUN\|MEH\)>n<LIN>$/\\mbox{<H>\1<NIL><\/H>\\kern-6pt<H><NIL>\2<\3><\/H>\\kern-0pt<H>n<LIN><\/H>}/
}
}
}
}