summaryrefslogtreecommitdiff
path: root/support/translit/tex-koi8.rus
blob: 9d425642dc29987e9b6c26b1bd9f72e25de0bdae (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# Jan Labanowski, jkl@osc.edu, Jan. 10, 1992
# File tex_koi8.rus

# This is a transliteration data file for converting from Latex to KOI8
# as used by RELCOM (GOST 19768-74). It assumes that the sister file:
# koi8-latex.rus was used to obtain the LaTeX file. 
# Since Latex is a program, frequently complicated, it is probably possible
# to convert LaTeX to KOI8 only with TeX. However, if you have a simple
# LaTeX document, without math, tables, different font sized and shapes,
# you can easily convert it to KOI8 tex, by listing symbols for Russian
# lettes on the left side and appropriate KOI8 codes on the right.
# Since there are many possible assignements in LaTeX, you need to
# modify this file to the ones actually used. First of all, some other
# symbols may be used to represent Russian letters. I included some more
# popular sequences, but there might be more, which I am not aware of.
# The TeX tranliteration sequences follow AMS cyrillic convention for
# WNCYR fonts with cyracc.def file
# To be used with translit.c program by Jan Labanowski. For a format of
# this file consult translit documentation

   1            file version number

   "    "      # string delimiters
   [    ]      # list delimites
   {    }      # regular expression delimiters


#starting sequence
""


#ending sequence
""


   4     # number input SHIFT sequences
# The last two of the input "character sets" are used simply to delete all
# characters from LaTeX preamble and the \end{document} closing
# For set 2, note that \cyr may be followed by spaces or new lines
# end preceded with some LaTeX escape sequences

#SO-match #SO-subs  #Nest-up  #Nest-down  #SI-match   #SI-subs
    ""       ""        ""         ""         ""         ""  #Latin letters

{{\\cyr[ \0x09-\0x0D]+}
             ""        "{"        "}"        "}"        ""  #cyrillic

"\documentstyle" 
             ""        ""         ""  {\begin{document\0x7D[\0d09-\15]*} ""

"\end{document}" ""    ""         ""         ""         ""


   0     # number of output SHIFT sequences, only one set of output characters

# conversion table
# inp_set     inp_seq           out_set    out_seq

     3   [\001-\255]                0     "\00"      # delete LaTeX preamble
     4   [\001-\255]                0     "\00"      # delete end{document}

     1      [A-Za-z]                0    [A-Za-z]    #Latin letters A-Z and a-z

# If double backslash is followed by new line, skip the double backslash
     0   {\\\\[\0x09-\0x0d]*}       0   "\0x0D\0x0A"    #restore new lines

     0       "\\040"                0         " "    # protected space


# Convert some special TeX characters

#  these do not require going out of {\cyr ....}
     0       "$[$"                    0         "["             
     0       "$]$"                    0         "]"             
     0       "$\wedge$"               0         "^"             
     0       "$\lbrace$"              0         "{"             
     0       "$\rbrace$"              0         "}"             
     0       "$\sim$"                 0         "~"             
     0       "$\backslash$"           0         "\"             
     0       "$\mid$"                 0         "|"             
     0       "$\star$"                0         "*"             
     0       "$<$"                    0         "<"             
     0       "$>$"                    0         ">"             
     0       "\$"                     0         "$"             
     0       "\%"                     0         "%"             

#  These were represented correctly only in Latin charset
     1       "\_"                     0         "_"       
     1       "\&"                     0         "&"       
     1       "\#"                     0         "#"       
     1       "\@"                     0         "@"       
     

# Cyrillic letters  

# note that TS and ts sequences are checked before the \cydot is removed

 2  {\\T[Ss][ \0x09-\0x0d]*}    0         "\0xE3"
 2       {T[Ss]}                0         "\0xE3"           # Tse

 2  {\\ts][ \0x09-\0x0d]*}      0         "\0xC3"
 2       {t[Ss]}                0         "\0xC3"           # tse

 2 {\\S[Hh][Cc][Hh][ \0x09-\0x0d]*} 0     "\0xFD"
 2 {S[Hh][Cc][Hh]}              0         "\0xFD"           

 2 {\\s[Hh][Cc][Hh][ \0x09-\0x0d]*} 0     "\0xDD"
 2 {s[Hh][Cc][Hh]}              0         "\0xDD"           

 2  {\\Cdprime[ \0x09-\0x0d]*}  0         "\0xFF"           # Tverdyj znak 
 2  {\\T[Zz][ \0x09-\0x0d]*}    0         "\0xFF"

 2  {\\Cprime[ \0x09-\0x0d]*}   0         "\0xF8"           # Myagkij znak 
 2  {\\M[Zz][ \0x09-\0x0d]*}    0         "\0xF8"

 2  {\\cdprime[ \0x09-\0x0d]*}  0         "\0xDF"           # tverdyj znak
 2  {\\tz[ \0x09-\0x0d]*}       0         "\0xDF"
 
 2  {\\cprime[ \0x09-\0x0d]*}   0         "\0xD8"           # myagkij znak
 2  {\\mz[ \0x09-\0x0d]*}       0         "\0xD8"

 2  {\\u[ \0x09-\0x0d]*I}       0         "\0xEA"          # I kratkoje 
 2  "\u{I}"                     0         "\0xEA"
 2  {\\[Uu]I[ \0x09-\0x0d]*}    0         "\0xEA"

 2  {\\u[ \0x09-\0x0d]*i}       0         "\0xCA"          # i kratkoje
 2  {\\ui[ \0x09-\0x0d]*}       0         "\0xCA"
 2  "\u{i}"                     0         "\0xCA"

 2  {\\`[ \0x09-\0x0d]*E}       0         "\0xFC"          # E obortnoye
 2  "\`{E}"                     0         "\0xFC"

 2  {\\`[ \0x09-\0x0d]*e}       0         "\0xDC"          # e oborotnoye
 2  "\`{e}"                     0         "\0xDC"

 2 {\\K[Hh][ \0x09-\0x0d]*}     0         "\0xE8"           
 2 {K[Hh]}                      0         "\0xE8"           

 2 {\\k[Hh][ \0x09-\0x0d]*}     0         "\0xC8"           
 2 {k[Hh]}                      0         "\0xC8"           

 2 {\\T[Cc][Hh][ \0x09-\0x0d]*} 0         "\0xFE"
 2 {\\C[Hh][ \0x09-\0x0d]*}     0         "\0xFE"
 2 {C[Hh]}                      0         "\0xFE"           


 2 {\\S[Hh][ \0x09-\0x0d]*}     0         "\0xFB"           
 2 {S[Hh]}                      0         "\0xFB"           

 2 {\\c[Hh][ \0x09-\0x0d]*}     0         "\0xDE"           
 2 {\\t[Cc][Hh][ \0x09-\0x0d]*} 0         "\0xDE"
 2 {c[Hh]}                      0         "\0xDE"           

 2 {\\s[Hh][ \0x09-\0x0d]*}     0         "\0xDB"           
 2 {s[Hh]}                      0         "\0xDB"           

 2 {\\Z[Hh][ \0x09-\0x0d]*}     0         "\0xF6"           
 2 {Z[Hh]}                      0         "\0xF6"           

 2 {\\z[Hh][ \0x09-\0x0d]*}     0         "\0xD6"           
 2 {z[Hh]}                      0         "\0xD6"           

 2 {\\Y[Uu][ \0x09-\0x0d]*}     0         "\0xE0"           
 2 {Y[Uu]}                      0         "\0xE0"           

 2 {\\Y[Aa][ \0x09-\0x0d]*}     0         "\0xF1"           
 2 {Y[Aa]}                      0         "\0xF1"           

 2 {\\y[Uu][ \0x09-\0x0d]*}     0         "\0xC0"           
 2 {y[Uu]}                      0         "\0xC0"           

 2 {\\y[Aa][ \0x09-\0x0d]*}     0         "\0xD1"           
 2 {y[Aa]}                      0         "\0xD1"           

 2 {\\"[ \0x09-\0x0D]*e}        0         "\0xA3"           # small \"e (yo)
 2 "\\0o42{e}"                  0         "\0xA3"
 2 {\\y[Oo][ \0x09-\0x0D]*}     0         "\0xA3"

 2 {\\"[ \0x09-\0x0D]*E}        0         "\0xB3"           # capital \"E (Yo)
 2 "\\0o42{E}"                  0         "\0xB3"
 2 {\\Y[Oo][ \0x09-\0x0D]*}     0         "\0xB3"

 2  {\\cydot[ \0x09-\0x0d]*}    0         ""                #\cydot out

    2       "H"                 0         "\0xE8"           
    2       "h"                 0         "\0xC8"           
    2       "W"                 0         "\0xFD"           
    2       "w"                 0         "\0xDD"           
    2       "X"                 0         "\0xFB"           
    2       "x"                 0         "\0xDB"           

    2       "A"                 0         "\0xE1"           
    2       "B"                 0         "\0xE2"           
    2       "V"                 0         "\0xF7"           
    2       "G"                 0         "\0xE7"           
    2       "D"                 0         "\0xE4"           
    2       "E"                 0         "\0xE5"           
    2       "Z"                 0         "\0xFA"           
    2       "I"                 0         "\0xE9"           
    2       "K"                 0         "\0xEB"           
    2       "L"                 0         "\0xEC"           
    2       "M"                 0         "\0xED"           
    2       "N"                 0         "\0xEE"           
    2       "O"                 0         "\0xEF"           
    2       "P"                 0         "\0xF0"           
    2       "R"                 0         "\0xF2"           
    2       "S"                 0         "\0xF3"           
    2       "T"                 0         "\0xF4"           
    2       "U"                 0         "\0xF5"           
    2       "F"                 0         "\0xE6"           
    2       "C"                 0         "\0xE3"           
    2       "Y"                 0         "\0xF9"           
    2       "a"                 0         "\0xC1"           
    2       "b"                 0         "\0xC2"           
    2       "v"                 0         "\0xD7"           
    2       "g"                 0         "\0xC7"           
    2       "d"                 0         "\0xC4"           
    2       "e"                 0         "\0xC5"           
    2       "z"                 0         "\0xDA"           
    2       "i"                 0         "\0xC9"           
    2       "k"                 0         "\0xCB"           
    2       "l"                 0         "\0xCC"           
    2       "m"                 0         "\0xCD"           
    2       "n"                 0         "\0xCE"           
    2       "o"                 0         "\0xCF"           
    2       "p"                 0         "\0xD0"           
    2       "r"                 0         "\0xD2"           
    2       "s"                 0         "\0xD3"           
    2       "t"                 0         "\0xD4"           
    2       "u"                 0         "\0xD5"           
    2       "f"                 0         "\0xC6"           
    2       "c"                 0         "\0xC3"           
    2       "y"                 0         "\0xD9"           

# Trash {}
    0       "{"                 0         ""