1 ⟨∗OT2⟩

 2 \NeedsTeXFormat{LaTeX2e}[1998/12/01]
 3 \ProvidesFile{ot2enc.def}
 4 [2001/08/11 v3.3a Cyrillic encoding definition file]

1 Definitions for the OT2 encoding

 5 \DeclareFontEncoding{OT2}{}{}
 6 \DeclareFontSubstitution{OT2}{cmr}{m}{n}

Accents:

 7 \DeclareTextAccent{\"}{OT2}{32}
 8 \DeclareTextAccent{\'}{OT2}{38}

There is a \U accent for the wide Cyrillic breve in addition to the \u accent used for the smaller breve. It is recommended to use \U accent for \U{i} and \U{u}. \U{i} has a composite declared below.

 9 \DeclareTextAccent{\u}{OT2}{64}
10 \DeclareTextAccent{\U}{OT2}{36}
11 \DeclareTextCommand{\d}{OT2}[1]
12 {\hmode@bgroup
13  \o@lign{\relax#1\crcr\hidewidth\sh@ft{10}.\hidewidth}\egroup}
14 \DeclareTextCommand{\.}{OT2}[1]{\TextSymbolUnavailable{\.{#1}}#1}

Letters. We declare all letters here, including the ones which are accessible either directly or via ligatures from Latin letters, because we can use an encodingindependent notation in Babel support files, shareable for all font encodings. It is even possible to use 7-bit OT2 font encoding with 8-bit input encodings; all letters become accessible for accents (there is a problem when putting an accent on letters treated as ligatures: E.g., in ordinary text ‘yu’ and ‘ya’ are rendered as soft ‘u’ and soft ‘a’, but \'{yu} does not produce a soft ‘u’ with an accent, but a ‘y’ with an accent followed by an ‘u’). We use an approach based on standard L^{A}TEX encoding-dependent symbols (but not definitions like \def\CYRA{A}) which allows one to use several Cyrillic font encodings in one document.

15 \DeclareTextSymbol{\CYRNJE}{OT2}{0}
16 \DeclareTextSymbol{\CYRLJE}{OT2}{1}
17 \DeclareTextSymbol{\CYRDZHE}{OT2}{2}
18 \DeclareTextSymbol{\CYREREV}{OT2}{3}
19 \DeclareTextSymbol{\CYRII}{OT2}{4}
20 \DeclareTextSymbol{\CYRIE}{OT2}{5}
21 \DeclareTextSymbol{\CYRDJE}{OT2}{6}
22 \DeclareTextSymbol{\CYRTSHE}{OT2}{7}
23 \DeclareTextSymbol{\cyrnje}{OT2}{8}
24 \DeclareTextSymbol{\cyrlje}{OT2}{9}
25 \DeclareTextSymbol{\cyrdzhe}{OT2}{10}
26 \DeclareTextSymbol{\cyrerev}{OT2}{11}
27 \DeclareTextSymbol{\cyrii}{OT2}{12}
28 \DeclareTextSymbol{\cyrie}{OT2}{13}
29 \DeclareTextSymbol{\cyrdje}{OT2}{14}
30 \DeclareTextSymbol{\cyrtshe}{OT2}{15}
31 \DeclareTextSymbol{\CYRYU}{OT2}{16}
32 \DeclareTextSymbol{\CYRZH}{OT2}{17}
33 \DeclareTextSymbol{\CYRISHRT}{OT2}{18}
34 \DeclareTextSymbol{\CYRYO}{OT2}{19}

35 \DeclareTextSymbol{\CYRIZH}{OT2}{20}
36 \DeclareTextSymbol{\CYRFITA}{OT2}{21}
37 \DeclareTextSymbol{\CYRDZE}{OT2}{22}
38 \DeclareTextSymbol{\CYRYA}{OT2}{23}
39 \DeclareTextSymbol{\cyryu}{OT2}{24}
40 \DeclareTextSymbol{\cyrzh}{OT2}{25}
41 \DeclareTextSymbol{\cyrishrt}{OT2}{26}
42 \DeclareTextSymbol{\cyryo}{OT2}{27}
43 \DeclareTextSymbol{\cyrizh}{OT2}{28}
44 \DeclareTextSymbol{\cyrfita}{OT2}{29}
45 \DeclareTextSymbol{\cyrdze}{OT2}{30}
46 \DeclareTextSymbol{\cyrya}{OT2}{31}
47 \DeclareTextSymbol{\CYRYAT}{OT2}{35}
48 \DeclareTextSymbol{\cyryat}{OT2}{43}

We use the same command for the dotless ‘i’ letter as in other encodings.

49 \DeclareTextSymbol{\i}{OT2}{61}
50 \DeclareTextSymbol{\CYRA}{OT2}{65}
51 \DeclareTextSymbol{\CYRB}{OT2}{66}
52 \DeclareTextSymbol{\CYRC}{OT2}{67}
53 \DeclareTextSymbol{\CYRD}{OT2}{68}
54 \DeclareTextSymbol{\CYRE}{OT2}{69}
55 \DeclareTextSymbol{\CYRF}{OT2}{70}
56 \DeclareTextSymbol{\CYRG}{OT2}{71}
57 \DeclareTextSymbol{\CYRH}{OT2}{72}
58 \DeclareTextSymbol{\CYRI}{OT2}{73}
59 \DeclareTextSymbol{\CYRJE}{OT2}{74}
60 \DeclareTextSymbol{\CYRK}{OT2}{75}
61 \DeclareTextSymbol{\CYRL}{OT2}{76}
62 \DeclareTextSymbol{\CYRM}{OT2}{77}
63 \DeclareTextSymbol{\CYRN}{OT2}{78}
64 \DeclareTextSymbol{\CYRO}{OT2}{79}
65 \DeclareTextSymbol{\CYRP}{OT2}{80}
66 \DeclareTextSymbol{\CYRCH}{OT2}{81}
67 \DeclareTextSymbol{\CYRR}{OT2}{82}
68 \DeclareTextSymbol{\CYRS}{OT2}{83}
69 \DeclareTextSymbol{\CYRT}{OT2}{84}
70 \DeclareTextSymbol{\CYRU}{OT2}{85}
71 \DeclareTextSymbol{\CYRV}{OT2}{86}
72 \DeclareTextSymbol{\CYRSHCH}{OT2}{87}
73 \DeclareTextSymbol{\CYRSH}{OT2}{88}
74 \DeclareTextSymbol{\CYRERY}{OT2}{89}
75 \DeclareTextSymbol{\CYRZ}{OT2}{90}
76 \DeclareTextSymbol{\CYRSFTSN}{OT2}{94}
77 \DeclareTextSymbol{\CYRHRDSN}{OT2}{95}
78 \DeclareTextSymbol{\cyra}{OT2}{97}
79 \DeclareTextSymbol{\cyrb}{OT2}{98}
80 \DeclareTextSymbol{\cyrc}{OT2}{99}
81 \DeclareTextSymbol{\cyrd}{OT2}{100}
82 \DeclareTextSymbol{\cyre}{OT2}{101}
83 \DeclareTextSymbol{\cyrf}{OT2}{102}
84 \DeclareTextSymbol{\cyrg}{OT2}{103}
85 \DeclareTextSymbol{\cyrh}{OT2}{104}
86 \DeclareTextSymbol{\cyri}{OT2}{105}

 87 \DeclareTextSymbol{\cyrje}{OT2}{106}
 88 \DeclareTextSymbol{\cyrk}{OT2}{107}
 89 \DeclareTextSymbol{\cyrl}{OT2}{108}
 90 \DeclareTextSymbol{\cyrm}{OT2}{109}
 91 \DeclareTextSymbol{\cyrn}{OT2}{110}
 92 \DeclareTextSymbol{\cyro}{OT2}{111}
 93 \DeclareTextSymbol{\cyrp}{OT2}{112}
 94 \DeclareTextSymbol{\cyrch}{OT2}{113}
 95 \DeclareTextSymbol{\cyrr}{OT2}{114}
 96 \DeclareTextSymbol{\cyrs}{OT2}{115}
 97 \DeclareTextSymbol{\cyrt}{OT2}{116}
 98 \DeclareTextSymbol{\cyru}{OT2}{117}
 99 \DeclareTextSymbol{\cyrv}{OT2}{118}
100 \DeclareTextSymbol{\cyrshch}{OT2}{119}
101 \DeclareTextSymbol{\cyrsh}{OT2}{120}
102 \DeclareTextSymbol{\cyrery}{OT2}{121}
103 \DeclareTextSymbol{\cyrz}{OT2}{122}
104 \DeclareTextSymbol{\cyrsftsn}{OT2}{126}
105 \DeclareTextSymbol{\cyrhrdsn}{OT2}{127}

Other symbols:

106 %\DeclareTextSymbol{\texthyphenchar}{OT2}{45}
107 %\DeclareTextSymbol{\texthyphen}{OT2}{45}
108 \DeclareTextSymbol{\textquoteleft}{OT2}{96}
109 \DeclareTextSymbol{\textquoteright}{OT2}{39}
110 \DeclareTextSymbol{\textquotedblleft}{OT2}{92}
111 \DeclareTextSymbol{\textquotedblright}{OT2}{34}
112 \DeclareTextSymbol{\guillemotleft}{OT2}{60}
113 \DeclareTextSymbol{\guillemotright}{OT2}{62}
114 \DeclareTextSymbol{\textendash}{OT2}{123}
115 \DeclareTextSymbol{\cyrdash}{OT2}{124}
116 \DeclareTextSymbol{\textemdash}{OT2}{124}
117 \DeclareTextSymbol{\textnumero}{OT2}{125}

Some ‘obvious’ composites:

118 \DeclareTextComposite{\U}{OT2}{I}{18}
119 \DeclareTextComposite{\U}{OT2}{i}{26}
120 \DeclareTextComposite{\"}{OT2}{E}{19}
121 \DeclareTextComposite{\"}{OT2}{e}{27}
122 \DeclareTextComposite{\.}{OT2}{\i}{12}

The following declarations will not work for 8-bit chars generated via inputenc unless a dblaccnt package is used.

123 \DeclareTextComposite{\U}{OT2}{\CYRI}{18}
124 \DeclareTextComposite{\U}{OT2}{\cyri}{26}
125 \DeclareTextComposite{\"}{OT2}{\CYRE}{19}
126 \DeclareTextComposite{\"}{OT2}{\cyre}{27}

127 ⟨/OT2⟩