Debian Codegraph @

texmf-dist/doc/latex/base/cyrguide.tex

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 1993-2025
4 % The LaTeX Project and any individual authors listed elsewhere
5 % in this file.
6 %
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
9 %
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
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.3c or later is part of all distributions of LaTeX
16 % version 2008 or later.
17 %
18 % This file has the LPPL maintenance status "maintained".
19 %
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
22 % information.
23 %
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
27 %
28 % \fi
29 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
30
31 \documentclass{ltxguide}[1999/02/28]
32
33 \title{Cyrillic languages support in \LaTeX}
34
35 \author{\copyright~Copyright 1998--1999,\\ Vladimir Volovich,
36 Werner Lemberg and \LaTeX\ Project Team.\\ All rights reserved.%
37 \footnote{This file may be distributed and/or modified under the
38 conditions of the \LaTeX{} Project Public License, either version 1.3c
39 of this license or (at your option) any later version. See the source
40 \texttt{cyrguide.tex} for full details.}%
41 }
42
43 \date{12 March 1999}
44
45 \begin{document}
46
47 \maketitle
48 \tableofcontents
49
50 \begin{abstract}
51 This document contains basic information on the Cyrillic setup for
52 \LaTeX{}: how to get the fonts, how to set them up, how to use
53 the interface, its interaction with \babel{}, etc. This is only a first
54 draft of the document and it will probably be modified in future; so
55 please send in comments on it via the \texttt{latexbug} system
56 (see below).
57 \end{abstract}
58
59
60 \section{Introduction}
61
62 Most Latin-based European languages were supported in \LaTeX{} by
63 introducing the~|T1|~font encoding and by using the \textsf{fontenc}
64 and \textsf{inputenc} packages; these use only standard \TeX{} means
65 to support any \mbox{8-bit} input encoding and this one standard font
66 encoding. The restriction to a single font encoding guarantees that
67 multiple languages can happily coexist in one document (\eg
68 hyphenation will be correct for all languages).
69
70 Starting with the December~1998 Release, \LaTeX{} finally supports
71 Cyrillic languages. This support is based on the new standard
72 Cyrillic \TeX{} font encodings---|T2A|, |T2B|, |T2C|, and~|X2|. The
73 first three of these satisfy some basic requirements for
74 \LaTeX{}~|T*|~encodings, and thus can be used in multi-lingual documents
75 with other languages based on standard font encodings.
76
77 The reason why we need four different Cyrillic font encodings is that
78 these font encodings support \emph{all} the Cyrillic languages that
79 have been used during the twentieth century (see
80 Section~\ref{fontencs})! The number of Cyrillic glyphs is large, so
81 they cannot be represented with 128~character slots; the other (lower)
82 128~slots are reserved for Latin letters and other invariant symbols
83 that are needed for the encoding to be a conformant
84 \LaTeX{}~\texttt{T}~encoding.
85
86 There are some glyphs in the |T2*|~encodings which do not yet have
87 associated characters in \emph{Unicode}, the world-wide character
88 standard. Also, one more font encoding, |T2D|,~is planned for a
89 forthcoming release of \LaTeX{}. A lot of Cyrillic input encodings
90 are already supported (see Section~\ref{inputencs}), and additional
91 encodings could be added easily.
92
93
94 \subsection{Acknowledgments}
95 \label{sec:acks}
96
97 The work on |T2*|~encodings was carried out by the T2~Team, led by
98 Alexander Berdnikov (other members are Mikhail Kolodin and Andrew
99 Janishewskii). The LH~fonts were produced by Olga Lapko (with
100 A.~Khodulev). The \textsf{T2} bundle and \textsf{ruhyphen} package
101 were written by Werner Lemberg and Vladimir Volovich (except that the
102 concrete hyphenation patterns which are part of \textsf{ruhyphen} came
103 from individual authors). The support for the Ukrainian language was
104 prepared by Andrij Shvaika.
105
106
107 \section{Installation}
108
109 The \textsf{fontenc} and \textsf{inputenc} packages are installed
110 automatically in every base \LaTeX{} distribution.
111
112 All the necessary extra files to use with these packages for Cyrillic
113 are in the \textsf{cyrillic} bundle, which at present contains the
114 following: four font encoding definition files (|t2aenc.def|,
115 |t2benc.def|, |t2cenc.def|, |x2enc.def|); several input encoding
116 definition files (all the other |*.def| files), and font definition
117 files (|*.fd|).
118 The installation of these is described here.
119
120 \subsection{Fonts}
121
122 The default font families in \LaTeX{} are the Computer Modern
123 families, namely the CM~fonts (|OT1|~encoded) and the EC~fonts
124 (|T1|~encoded). The LH~fonts, which are now available, provide
125 Computer Modern fonts for all Cyrillic font encodings. They are
126 designed to be compatible with the EC~fonts, and they provide the same
127 font shapes and sizes; they are available at |CTAN:fonts/cyrillic/lh|
128 (the latest version is 3.20). The installation instructions for the
129 fonts are in the file |INSTALL| in the font distribution.
130
131 Other fonts, including Type~1 fonts, can also be used, provided that
132 their encoding (for \TeX{}) is \mbox{|T2|-compatible}. Some
133 ready-to-use packages supporting such fonts are also available, \eg at
134 \URL{ftp://ftp.vsu.ru/pub/tex} (they should soon be on \ctan). Currently,
135 you will find two packages there: \textsf{PsCyr}, which contains some
136 freely distributable Cyrillic Type~1 fonts with support for \LaTeX{};
137 and \textsf{c1fonts}, which contains virtual fonts similar to the
138 \textsf{AE}~fonts package using the BlueSky and BaKoMa fonts
139 available from \ctan{} (see the |README| file in that package for
140 detailed information). Further font packages are expected soon.
141
142 \subsection{Hyphenation patterns}
143
144 You can find a collection of hyphenation patterns for the Russian
145 language in the \textsf{ruhyphen} package at
146 |CTAN:language/hyphenation/ruhyphen|. These patterns support the
147 |T2*|~encodings, as well as other popular font encodings used for
148 Russian typesetting (including the Omega internal encoding).
149 Patterns for other Cyrillic languages should be adapted to work with
150 the |T2*|~encodings.
151
152 \subsection{\babel{} support for Russian and Ukrainian}
153 \label{bblrus}
154
155 Version~3.6k of \babel{} includes support for the |T2*|~encodings and
156 for typesetting both Russian and Ukrainian texts using the Cyrillic
157 letters. The temporary fontencoding |LWN|, which was used in earlier
158 releases of \babel{}, will be withdrawn in the near future and replaced
159 by the |OT2| encoding.
160
161 \subsection{Getting pre-built packages}
162
163 Many of the major \TeX{} distributions, such as te\TeX{}, fp\TeX{} and
164 \TeX{}live, contain (or soon will) everything that is needed,
165 including the LH~fonts, \textsf{ruhyphen} and the latest version of
166 \babel{}. We hope that all \TeX{} distributions will soon include all
167 of these, so that the chances are that you will not need to install
168 this by yourself (but it is not difficult).
169
170 If you are using em\TeX, Mik\TeX, or fp\TeX, you
171 can download the \textsf{ruemtex} package from
172 \URL{ftp://ftp.vsu.ru/pub/tex}.
173
174 \section{Usage}
175
176 Support for Cyrillic is based on these standard \LaTeX{} mechanisms:
177 the \textsf{fontenc} and \textsf{inputenc} packages (and on \babel{}).
178 Thus the basic principles for its use are similar to those for other
179 European languages: you simply add, to your document preamble, lines
180 like the following.
181
182 \begin{verbatim}
183 \usepackage[T2A]{fontenc}
184 \usepackage[koi8-r]{inputenc}
185 \end{verbatim}
186
187 Here you can put any desired input encoding instead of
188 \mbox{\texttt{koi8-r}}: for example, it would be \texttt{cp866} if you are
189 using a MS-DOS text editor with this Cyrillic code page to prepare your
190 documents, or \texttt{cp1251} if you are a MS~Windows user with Cyrillic
191 support. A full list of the available Cyrillic encodings can be found in
192 Section~\ref{inputencs} and in the file |cyinpenc.dtx|.
193
194 Documents are, naturally, not restricted to a single font encoding;
195 this is essential for multi-lingual journals or documents. Such
196 changes can be made by using the |\fontencoding| command as part of a
197 font-change. However, it is best to access these font encodings via a
198 higher-level interface.
199
200 Since such changes are often closely related to other
201 language-dependent settings, it is often sensible to use the \babel{}
202 system, which provides further useful `localisation' and standardised
203 multi-lingual interfaces (for further details, see
204 Section~\ref{bblrus}). Then you can use lines like the following in
205 your document:
206
207 \begin{verbatim}
208 \usepackage[koi8-r]{inputenc}
209 \usepackage[russian]{babel}
210 \end{verbatim}
211
212 This will automatically choose the default font encoding for Russian,
213 which is |T2A|, if available. Documentation of the complete set of
214 font-encoding selection rules can be found in |cyrillic.dtx| which is
215 part of |rusbabel|.
216
217 These \LaTeX{} interfaces are very convenient because they make your
218 documents completely portable, being based solely on standard \TeX{}
219 features. This will mean that your documents can be processed on any
220 \TeX{} system without any need for re-encoding to the `native'
221 encoding used on each platform; this is because the encoding of the
222 document is specified in the document itself.
223
224 Moreover, if necessary, more than one input encoding can be used
225 within a document; this could be useful if, for example, you need to
226 combine articles prepared by authors on different machines. Each part
227 of the document is then identified by a |\inputencoding| command,
228 which can therefore only be used between paragraphs.
229
230 Please note that you must always use the two standard \LaTeX{}
231 commands, |\MakeUppercase| and |\MakeLowercase| to produce uppercase
232 or lowercase text in your documents. This is because |\uppercase| and
233 |\lowercase| will not work at all for Cyrillic (note that these latter
234 two commands are not, and never have been, available for use directly
235 in \LaTeX{} documents).
236
237
238 \section{Font encodings for Cyrillic languages}
239 \label{fontencs}
240
241 The Cyrillic font encodings support the following languages. Note
242 that some languages can be properly typeset with more than one
243 encoding.
244
245 \begin{itemize}
246 \raggedright
247 \item[|T2A|:]
248 Abaza, Avar, Agul, Adyghei, Azerbaijani, Altai, Balkar, Bashkir,
249 Bulgarian, Buryat, Byelorussian, Gagauz, Dargin, Dungan, Ingush,
250 Kabardino-Cherkess, Kazakh, Kalmyk, Karakalpak, Karachaevskii,
251 Karelian, Kirghiz, Komi-Zyrian, Komi-Permyak, Kumyk, Lak, Lezghin,
252 Macedonian, Mari-Mountain, Mari-Valley, Moldavian, Mongolian,
253 Mordvin-Moksha, Mordvin-Erzya, Nogai, Oroch, Osetin, Russian, Rutul,
254 Serbian, Tabasaran, Tadzhik, Tatar, Tati, Teleut, Tofalar, Tuva,
255 Turkmen, Udmurt, Uzbek, Ukrainian, Hanty-Obskii, Hanty-Surgut,
256 Gipsi, Chechen, Chuvash, Crimean-Tatar.
257 \item[|T2B|:]
258 Abaza, Avar, Agul, Adyghei, Aleut, Altai, Balkar, Byelorussian,
259 Bulgarian, Buryat, Gagauz, Dargin, Dolgan, Dungan, Ingush, Itelmen,
260 Kabardino-Cherkess, Kalmyk, Karakalpak, Karachaevskii, Karelian,
261 Ketskii, Kirghiz, Komi-Zyrian, Komi-Permyak, Koryak, Kumyk, Kurdian,
262 Lak, Lezghin, Mansi, Mari-Valley, Moldavian, Mongolian,
263 Mordvin-Moksha, Mordvin-Erzya, Nanai, Nganasan, Negidal, Nenets,
264 Nivh, Nogai, Oroch, Russian, Rutul, Selkup, Tabasaran, Tadzhik,
265 Tatar, Tati, Teleut, Tofalar, Tuva, Turkmen, Udyghei, Uigur, Ulch,
266 Khakass, Hanty-Vahovskii, Hanty-Kazymskii, Hanty-Obskii,
267 Hanty-Surgut, Hanty-Shurysharskii, Gipsi, Chechen, Chukcha, Shor,
268 Evenk, Even, Enets, Eskimo, Yukagir, Crimean Tatar, Yakut.
269 \item[|T2C|:]
270 Abkhazian, Bulgarian, Gagauz, Karelian, Komi-Zyrian, Komi-Permyak,
271 Kumyk, Mansi, Moldavian, Mordvin-Moksha, Mordvin-Erzya, Nanai,
272 Orok (Uilta), Negidal, Nogai, Oroch, Russian, Saam, Old-Bulgarian,
273 Old-Russian, Tati, Teleut, Hanty-Obskii, Hanty-Surgut, Evenk,
274 Crimean Tatar.
275 \end{itemize}
276
277 The |X2|~encoding was designed to support all the above languages.
278 Its name does not start with |T| because, for example, it contains no
279 Latin letters (it is purely a Cyrillic glyph container); it therefore
280 cannot be used in mixed-script documents along with the other |T*|
281 encodings. Please consult Section~6.4 \textit{Naming conventions} of
282 the file |fntguide.tex| in the base \LaTeX{} distribution for details
283 of the differences between \LaTeX{} font encodings and how they are
284 named.
285
286 There are two other \LaTeX{} Cyrillic font encodings, |OT2| and |LCY|,
287 that are not included in the base \LaTeX{} distribution. The first is
288 a \mbox{7-bit} encoding (hence the |O|) developed by the AMS; it is
289 useful for typesetting relatively small fragments of text in Cyrillic,
290 using a Latin transliteration scheme. The other, |LCY|, is an
291 \mbox{8-bit} Cyrillic encoding which is not compatible with the
292 requirements for \LaTeX{} |T*|~encodings (hence the |L|); thus it is not
293 suitable for typesetting multi-lingual documents, but it can be used in
294 Plain \TeX{}-based macro packages because it is an extension of |OT1|.
295 These two encodings are supported by \babel{} and by \textsf{ot2cyr}.
296
297
298 \section{Input encodings}
299 \label{inputencs}
300
301 Several Cyrillic code-pages are widely used. Currently, \LaTeX{}
302 contains support for 20~Cyrillic input encodings (some of which are
303 variants of each other).
304
305 \begin{itemize}
306
307 \item |cp855| --- the standard \mbox{MS-DOS} Cyrillic code-page.
308
309 \item |cp866| --- the standard \mbox{MS-DOS} Russian code-page.
310 Several code-pages very similar to this are also supported
311 (the differences are all in the range 242--254).
312 \begin{itemize}
313 \item |cp866av| -- the `Cyrillic Alternative' code-page (an
314 alternative variant of cp866);
315 \item |cp866mav| -- the `Modified Alternative Variant';
316 \item |cp866nav| -- the `New Alternative Variant';
317 \item |cp866tat| -- an experimental Tatarian code-page.
318 \end{itemize}
319
320 \item |cp1251| --- the standard MS Windows Cyrillic code-page.
321
322 \item \mbox{\texttt{koi8-r}} --- a standard Cyrillic code-page widely
323 used in UNIX-like systems for Russian language support that is
324 specified in RFC~1489. The situation with \mbox{\texttt{koi8-r}} is
325 somewhat similar to that for |cp866|: there are several similar
326 code-pages which coincide for all Russian letters but add some other
327 Cyrillic letters. The following are supported:
328 \begin{itemize}
329 \item \mbox{\texttt{koi8-u}} -- for Ukrainian;
330 \item \mbox{\texttt{koi8-ru}} -- this is described in a draft RFC
331 document specifying a widely used character set for mail and news
332 exchange in the Ukrainian internet community, as well as for
333 presenting WWW information resources in the Ukrainian language;
334 \item |isoir111| -- the \mbox{ISO-IR-111 ECMA} Cyrillic Code Page.
335 \end{itemize}
336
337 \item |iso88595| --- the \mbox{ISO 8859-5} Cyrillic code-page (also called
338 \mbox{ISO-IR-144}).
339
340 \item |maccyr| --- the Apple Macintosh Cyrillic code-page (also known
341 as Microsoft cp10007) and |macukr|, the Apple Macintosh Ukrainian
342 code-page, very similar to the Cyrillic code-page.
343
344 \item The Mongolian code-pages: |ctt| |dbk| |mnk| |mos| |ncc| |mls|.
345 These code-pages were taken from Oliver Corff's `Mon\TeX' package
346 (available at |CTAN:language/mongolian/montex|). Since the |T2*|
347 encodings support the Mongolian Cyrillic script, it is convenient to
348 have support for Mongolian input encodings as well. Pointers to
349 documentation for these code-pages will be much appreciated.
350
351 \end{itemize}
352
353
354 \section{Reporting bugs}
355
356 In case you find a bug and want to report it, please follow the
357 guidelines given in the file |bugs.txt| in the base \LaTeX{}
358 distributions. Note that there is a category specifically for
359 reporting any bugs that occur only when using Cyrillic fonts or
360 support packages.
361
362
363 \section{Miscellanea in the \textsf{T2} bundle}
364 \label{t2m}
365
366 The \textsf{T2}~bundle at |CTAN:macros/latex/contrib/supported/t2|
367 contains some other useful files, including support for Plain
368 \TeX{}-based macro packages, support for Bib\TeX{} and MakeIndex (see
369 also the \textsf{xindy} program and package---highly recommended for
370 making indices with Cyrillic), support for the \textsf{fontinst}
371 package, mapping tables relating these Cyrillic font encodings (and
372 input encodings) to the Unicode character names and slots (these are
373 in the subdirectory |enc-maps|), and more!
374
375 To produce documented source listings of the \textsf{T2}~package, run
376 \LaTeX{} on the |*.dtx| and |*.fdd| files therein.
377
378 When typesetting Cyrillic texts, there is a tradition of using
379 Cyrillic letters (in some situations) within math formul\ae, in
380 exactly the same way as most of the world uses Latin letters.
381 By default this does not work, because symbols declared with
382 |\DeclareTextSymbol| may not be used in math.
383
384 If you need within math to `transparently' typeset glyphs declared in
385 font encoding definition files, then you could try using the
386 experimental \textsf{mathtext} package, which is also in the
387 \textsf{T2}~bundle. Note that this package uses up at least one
388 additional math alphabet per font encoding. For this and other
389 reasons, The \LaTeX\ Project Team considers that this experimental
390 extension to \LaTeX{}'s glyph-handling mechanisms should be used with
391 caution; but please try it out and send us your opinions and ideas.
392 Note that it is not included in the core of \LaTeX{} because both the
393 coding and the interfaces are likely to change at some point in the
394 future.
395
396 Finally, here are some pointers to further information:
397
398 \begin{quote}
399 \URL{http://www.cemi.rssi.ru/cyrtug}\\
400 \URL{http://xtalk.price.ru/tex}
401 \end{quote}
402
403 \end{document}