1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2008 2009
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the Standard LaTeX `Cyrillic Bundle'.
8 % ----------------------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3b
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3b or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % The list of all files belonging to the `Cyrillic Bundle' is
19 % given in the file `manifest.txt'.
23 % This is the file |lcy.dtx| of the cyrillic bundle for LaTeX2e.
25 % Copyright (C) 1995-1997 Olga Lapko, Johannes L. Braams
26 % Copyright (C) 1998-2001 Werner Lemberg, Vladimir Volovich
29 \documentclass{ltxdoc}
38 \NeedsTeXFormat{LaTeX2e}[1998/12/01]
39 \ProvidesFile{lcyenc.def}
40 [2004/05/28 v3.4d Cyrillic encoding definition file]
43 % \section{Definitions for the \texttt{LCY} encoding}
45 % The definitions for the `\TeX{} text Cyrillic' (|LCY|) encoding.
47 % The |LCY| encoding is an extension of the |OT1| encoding; all lower
48 % 128 positions are the same (and this part of the file was taken from
49 % ot1enc.def), but most of the upper 128 positions are used for Cyrillic
52 % Important note: The |LCY| font encoding is \emph{incompatible} with the
53 % \LaTeXe\ standard conventions regarding uccode and lccode settings!
54 % Therefore, the |LCY| font encoding should not be used in a multilingual
55 % environment (for example, Russian, German, and English), because the
56 % hyphenation will be broken! Instead, use the new standard Cyrillic
57 % encodings |T2A|, |T2B|, |T2C| and |X2| defined in the \textsf{cyrillic}
58 % bundle for \LaTeXe. One can only use |LCY| to typeset at most bilingual
59 % Russian-English documents.
61 % Because of this incompatibility we have to set the lccode values,
62 % which are important for \TeX's hyphenation process, to match the |LCY|
63 % encoding. We do not need to set the uccode and catcode values because
64 % they are unused in hyphenation process, and uppercase
65 % $\leftrightarrow$ lowercase translation is defined via another
66 % mechanism in |\MakeUppercase| and |\MakeLowercase| commands. Again,
67 % this change of lccodes will break hyphenation for other languages with
68 % standard 8-bit font encodings! It is useless to make these changes in
69 % |\extrasrussian| (i.e., `locally') for the same reason, so we make
70 % global changes, which are stored in the file |lcydefs.tex| defined
73 % Note that \emph{it is not sufficient to use the |LCY| encoding via the
74 % \textsf{fontenc} package, but one also should load a file |lcydefs.tex|
75 % which sets lccode and other \TeX\ registers for |LCY| encoding
76 % globally (breaking standard 8-bit font encodings)}. For this reason we
77 % created also a wrapper package `lcy' which is a preferred mechanism
78 % for using the |LCY| font encoding, --- it loads |LCY| encoding
79 % definition file and |lcydefs.tex|.
81 % We rely on \LaTeX\ to set the |\@uclclist|, and thus the
82 % |\NeedsTeXFormat| line above.
84 % Declare the Local Cyrillic encoding. Specify a default for the font
85 % substitution process for the |LCY| encoding.
87 \DeclareFontEncoding{LCY}{}{}
88 \DeclareFontSubstitution{LCY}{cmr}{m}{n}
90 % Declare the accents.
92 \DeclareTextAccent{\"}{LCY}{127}
93 \DeclareTextAccent{\'}{LCY}{19}
94 \DeclareTextAccent{\.}{LCY}{95}
95 \DeclareTextAccent{\=}{LCY}{22}
96 \DeclareTextAccent{\^}{LCY}{94}
97 \DeclareTextAccent{\`}{LCY}{18}
98 \DeclareTextAccent{\~}{LCY}{126}
99 \DeclareTextAccent{\H}{LCY}{125}
100 \DeclareTextAccent{\u}{LCY}{21}
101 \DeclareTextAccent{\v}{LCY}{20}
102 \DeclareTextAccent{\r}{LCY}{23}
104 % A fake accent for the Cyrillic breve.
106 \DeclareTextCommand{\U}{LCY}[1]{\TextSymbolUnavailable{\U{#1}}#1}
108 % Some accents have to be built by hand:
110 \DeclareTextCommand{\b}{LCY}[1]
111 {\hmode@bgroup\o@lign{\relax#1\crcr\hidewidth\sh@ft{29}%
112 \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}\egroup}
113 \DeclareTextCommand{\c}{LCY}[1]
114 {\leavevmode\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1%
115 \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}
116 \DeclareTextCommand{\d}{LCY}[1]
118 \o@lign{\relax#1\crcr\hidewidth\sh@ft{10}.\hidewidth}\egroup}
120 % Declare the text symbols.
122 \DeclareTextSymbol{\AE}{LCY}{29}
123 \DeclareTextSymbol{\OE}{LCY}{30}
124 \DeclareTextSymbol{\O}{LCY}{31}
125 \DeclareTextSymbol{\ae}{LCY}{26}
126 \DeclareTextSymbol{\i}{LCY}{16}
127 \DeclareTextSymbol{\j}{LCY}{17}
128 \DeclareTextSymbol{\oe}{LCY}{27}
129 \DeclareTextSymbol{\o}{LCY}{28}
130 \DeclareTextSymbol{\ss}{LCY}{25}
131 \DeclareTextSymbol{\textemdash}{LCY}{124}
132 \DeclareTextSymbol{\textendash}{LCY}{123}
133 \DeclareTextSymbol{\textexclamdown}{LCY}{60}
134 %\DeclareTextSymbol{\texthyphenchar}{LCY}{`\-}
135 %\DeclareTextSymbol{\texthyphen}{LCY}{`\-}
136 \DeclareTextSymbol{\textquestiondown}{LCY}{62}
137 \DeclareTextSymbol{\textquotedblleft}{LCY}{92}
138 \DeclareTextSymbol{\textquotedblright}{LCY}{`\"}
139 \DeclareTextSymbol{\textquoteleft}{LCY}{`\`}
140 \DeclareTextSymbol{\textquoteright}{LCY}{`\'}
142 % Some symbols which are faked from others:
144 \DeclareTextCommand{\L}{LCY}
145 {\leavevmode\setbox\z@\hbox{L}\hb@xt@\wd\z@{\hss\@xxxii L}}
146 \DeclareTextCommand{\l}{LCY}
147 {\hmode@bgroup\@xxxii l\egroup}
149 %\DeclareTextCommand{\AA}{LCY}
150 % {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
151 % \rlap{\raise.67\dimen@\hbox{\char23}}A}
152 %\DeclareTextCommand{\aa}{LCY}{{\accent23a}}
156 % In the |LCY| encoding `\r A' has a hand-crafted definition:
158 \DeclareTextCompositeCommand{\r}{LCY}{A}
159 {\leavevmode\setbox\z@\hbox{!}\dimen@\ht\z@\advance\dimen@-1ex%
160 \rlap{\raise.67\dimen@\hbox{\char23}}A}
163 % In the |LCY| encoding, `\pounds' and `\$' share a slot.
165 \DeclareTextCommand{\textdollar}{LCY}{\hmode@bgroup
166 \ifdim \fontdimen\@ne\font >\z@
172 \DeclareTextCommand{\textsterling}{LCY}{\hmode@bgroup
173 \ifdim \fontdimen\@ne\font >\z@
176 \fontshape{ui}\selectfont
180 % And now, the Cyrillic part of the |LCY| encoding:
182 \DeclareTextSymbol{\CYRA}{LCY}{128}
183 \DeclareTextSymbol{\CYRB}{LCY}{129}
184 \DeclareTextSymbol{\CYRV}{LCY}{130}
185 \DeclareTextSymbol{\CYRG}{LCY}{131}
186 \DeclareTextSymbol{\CYRD}{LCY}{132}
187 \DeclareTextSymbol{\CYRE}{LCY}{133}
188 \DeclareTextSymbol{\CYRZH}{LCY}{134}
189 \DeclareTextSymbol{\CYRZ}{LCY}{135}
190 \DeclareTextSymbol{\CYRI}{LCY}{136}
191 \DeclareTextSymbol{\CYRISHRT}{LCY}{137}
192 \DeclareTextSymbol{\CYRK}{LCY}{138}
193 \DeclareTextSymbol{\CYRL}{LCY}{139}
194 \DeclareTextSymbol{\CYRM}{LCY}{140}
195 \DeclareTextSymbol{\CYRN}{LCY}{141}
196 \DeclareTextSymbol{\CYRO}{LCY}{142}
197 \DeclareTextSymbol{\CYRP}{LCY}{143}
198 \DeclareTextSymbol{\CYRR}{LCY}{144}
199 \DeclareTextSymbol{\CYRS}{LCY}{145}
200 \DeclareTextSymbol{\CYRT}{LCY}{146}
201 \DeclareTextSymbol{\CYRU}{LCY}{147}
202 \DeclareTextSymbol{\CYRF}{LCY}{148}
203 \DeclareTextSymbol{\CYRH}{LCY}{149}
204 \DeclareTextSymbol{\CYRC}{LCY}{150}
205 \DeclareTextSymbol{\CYRCH}{LCY}{151}
206 \DeclareTextSymbol{\CYRSH}{LCY}{152}
207 \DeclareTextSymbol{\CYRSHCH}{LCY}{153}
208 \DeclareTextSymbol{\CYRHRDSN}{LCY}{154}
209 \DeclareTextSymbol{\CYRERY}{LCY}{155}
210 \DeclareTextSymbol{\CYRSFTSN}{LCY}{156}
211 \DeclareTextSymbol{\CYREREV}{LCY}{157}
212 \DeclareTextSymbol{\CYRYU}{LCY}{158}
213 \DeclareTextSymbol{\CYRYA}{LCY}{159}
217 \DeclareTextSymbol{\cyra}{LCY}{160}
218 \DeclareTextSymbol{\cyrb}{LCY}{161}
219 \DeclareTextSymbol{\cyrv}{LCY}{162}
220 \DeclareTextSymbol{\cyrg}{LCY}{163}
221 \DeclareTextSymbol{\cyrd}{LCY}{164}
222 \DeclareTextSymbol{\cyre}{LCY}{165}
223 \DeclareTextSymbol{\cyrzh}{LCY}{166}
224 \DeclareTextSymbol{\cyrz}{LCY}{167}
225 \DeclareTextSymbol{\cyri}{LCY}{168}
226 \DeclareTextSymbol{\cyrishrt}{LCY}{169}
227 \DeclareTextSymbol{\cyrk}{LCY}{170}
228 \DeclareTextSymbol{\cyrl}{LCY}{171}
229 \DeclareTextSymbol{\cyrm}{LCY}{172}
230 \DeclareTextSymbol{\cyrn}{LCY}{173}
231 \DeclareTextSymbol{\cyro}{LCY}{174}
232 \DeclareTextSymbol{\cyrp}{LCY}{175}
233 \DeclareTextSymbol{\cyrr}{LCY}{224}
234 \DeclareTextSymbol{\cyrs}{LCY}{225}
235 \DeclareTextSymbol{\cyrt}{LCY}{226}
236 \DeclareTextSymbol{\cyru}{LCY}{227}
237 \DeclareTextSymbol{\cyrf}{LCY}{228}
238 \DeclareTextSymbol{\cyrh}{LCY}{229}
239 \DeclareTextSymbol{\cyrc}{LCY}{230}
240 \DeclareTextSymbol{\cyrch}{LCY}{231}
241 \DeclareTextSymbol{\cyrsh}{LCY}{232}
242 \DeclareTextSymbol{\cyrshch}{LCY}{233}
243 \DeclareTextSymbol{\cyrhrdsn}{LCY}{234}
244 \DeclareTextSymbol{\cyrery}{LCY}{235}
245 \DeclareTextSymbol{\cyrsftsn}{LCY}{236}
246 \DeclareTextSymbol{\cyrerev}{LCY}{237}
247 \DeclareTextSymbol{\cyryu}{LCY}{238}
248 \DeclareTextSymbol{\cyrya}{LCY}{239}
252 \DeclareTextSymbol{\CYRYO}{LCY}{240}
253 \DeclareTextSymbol{\cyryo}{LCY}{241}
254 \DeclareTextSymbol{\CYRGUP}{LCY}{242}
255 \DeclareTextSymbol{\cyrgup}{LCY}{243}
256 \DeclareTextSymbol{\CYRIE}{LCY}{244}
257 \DeclareTextSymbol{\cyrie}{LCY}{245}
258 \DeclareTextSymbol{\CYRII}{LCY}{246}
259 \DeclareTextSymbol{\cyrii}{LCY}{247}
260 \DeclareTextSymbol{\CYRYI}{LCY}{248}
261 \DeclareTextSymbol{\cyryi}{LCY}{249}
262 \DeclareTextSymbol{\CYRUSHRT}{LCY}{250}
263 \DeclareTextSymbol{\cyrushrt}{LCY}{251}
267 \DeclareTextSymbol{\cyrdash}{LCY}{196}
268 \DeclareTextSymbol{\textcurrency}{LCY}{197}
269 \DeclareTextSymbol{\textnumero}{LCY}{252}
270 \DeclareTextSymbol{\guillemotleft}{LCY}{253}
271 \DeclareTextSymbol{\guillemotright}{LCY}{254}
272 \DeclareTextSymbol{\quotedblbase}{LCY}{255}
274 % Text composites. The following declarations will not work for 8-bit
275 % chars generated via |inputenc| unless a |dblaccnt| package is used.
277 \DeclareTextComposite{\"}{LCY}{\CYRE}{240}
278 \DeclareTextComposite{\"}{LCY}{\cyre}{241}
279 \DeclareTextComposite{\U}{LCY}{\CYRI}{137}
280 \DeclareTextComposite{\U}{LCY}{\cyri}{169}
281 \DeclareTextComposite{\"}{LCY}{\CYRII}{248}
282 \DeclareTextComposite{\"}{LCY}{\cyrii}{249}
283 \DeclareTextComposite{\U}{LCY}{\CYRU}{250}
284 \DeclareTextComposite{\U}{LCY}{\cyru}{251}
288 % \section{Setup \{cat,uc,lc,sf,math\}code values for LCY font encoding}
290 % We store this setup in a separate file, |lcydefs.tex|, which is
291 % used also in a `cyrplain' bundle for Plain \TeX.
297 % Do not break inputenc:
299 \ifnum\catcode#1=13\else\catcode#1=11 \catcode#2=11 \fi
300 \uccode#1=#1 \uccode#2=#1
301 \lccode#1=#2 \lccode#2=#2
302 \sfcode#1=999 \sfcode#2=1000
303 \count255=#1 \advance\count255 "7000 \mathcode#1=\count255
304 \count255=#2 \advance\count255 "7000 \mathcode#2=\count255
347 \let\letter\undefined
349 % To avoid bad hyphenation of words delimited with non-letter signs
350 % (like quotes), we have to zero uc/lccode parameters for these
353 \lccode 196=0 \uccode 196=0 \lccode 197=0 \uccode 197=0
354 \lccode 252=0 \uccode 252=0 \lccode 253=0 \uccode 253=0
355 \lccode 254=0 \uccode 254=0 \lccode 255=0 \uccode 255=0
359 % \section{A wrapper package for the \texttt{LCY} encoding}
363 \ProvidesPackage{lcy}[1999/06/06 v1.0 Wrapper for LCY encoding]
365 % You can use the `\textsf{nowarn}' option to suppress boring warning.
367 \DeclareOption{nowarn}{\let\iflcy@warn\iffalse}
368 \let\iflcy@warn\iftrue
372 ****************************************************^^J%
373 * The LCY encoding will break multilingual documents^^J%
374 * because it needs non-standard uc/lccode settings.^^J%
375 * Please use T2* encodings instead.^^J%
376 ****************************************************}
378 \RequirePackage[LCY]{fontenc}