% $Id: russian.sty,v 1.5 2002/09/18 16:21:15 andrei Exp $
%% This is russian.sty
% A package file for Russian texts - to be customized locally
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Copyright 1998-2002 by Andrei G. Demekhov, andrei@appl.sci-nnov.ru
%  Institute of Applied Physics
%  603950 Ulyanov st., Nizhny Novgorod, Russia
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Distribution of this file is covered by the GNU Public Licence
%%
\def\fileversion{v1.5}
\def\filedate{2002/09/18}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{russian}
    [\filedate\space\fileversion\space Loads cyrillic font defs + some Russian defs]

% This 'hack' has been stolen from aguplus.cls by Patrick W. Daly
% We use it to figure out which cyrillic package to require
\def\getCYRfonts{\edef\CYRfonts{\CurrentOption}}
\def\getCYRpack{\edef\CYRpack{\CurrentOption}}

% Do we use new (fontenc/inputenc) setup for Cyrillic? Default=yes
\newif\if@newcyrsetup\@newcyrsetuptrue
\newif\if@babel

%% выбор шрифта
\DeclareOption{cmcyralt}{\getCYRfonts\@newcyrsetupfalse}
\DeclareOption{koi8}{\getCYRpack\let\CYRfonts\@undefined\@newcyrsetupfalse}
\DeclareOption{cyrcm1}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
\DeclareOption{literat}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
%% дальше опции для шрифтов из пакета scalable-cyrfonts (Anton Zinoviev)
\DeclareOption{cyrtimes}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
% cyrtimes          Times                  Helvetica       Courier
% cyrbookman        Bookman Light          Avant Garde     Courier
\DeclareOption{cyrbookman}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
% cyrnewcent        New Century Schoolbook Avant Garde     Courier
\DeclareOption{cyrnewcent}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
% cyrpalatino       Palatino               Helvetica       Courier
\DeclareOption{cyrpalatino}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
% teams             Teams                  Avant Garde     Courier
\DeclareOption{teams}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
% cyrncntrsbk       New Century Schoolbook (undefined)     (undefined)
\DeclareOption{cyrncntrsbk}{\expandafter\if@newcyrsetup\getCYRfonts\fi}
% cyrhelvetic       Helvetica              (undefined)     (undefined)
% cyrhelvet         (undefined)            Helvetica       (undefined)
% cyravantgar       Avant Garde            (undefined)     (undefined)
% cyravant          (undefined)            Avant Garde     (undefined)
% cyrcourier        (undefined)            (undefined)     Courier
%% бабель и кодировки
\DeclareOption{babel}{\@babeltrue}
\DeclareOption{nobabel}{\@babelfalse}
\DeclareOption{koi8-r}{\edef\InpEnc{\CurrentOption}}
\DeclareOption{cp866}{\edef\InpEnc{\CurrentOption}}
\DeclareOption{cp1251}{\edef\InpEnc{\CurrentOption}}

%% Default is loading LH typeface
\ExecuteOptions{babel,koi8-r}
\InputIfFileExists{russian.cfg}{}{}
\ProcessOptions

%% Default is loading the cmcyralt font package
\@ifundefined{CYRfonts}
 {\PackageWarning{russian}{Cyrillic fonts not specified,\MessageBreak
                         will try LH...}%
 }{}

\if@newcyrsetup%
\RequirePackage{mathtext}
\RequirePackage[T2A]{fontenc}
\RequirePackage[\InpEnc]{inputenc}
\RequirePackage{\CYRfonts}
\AtEndOfPackage{\if@babel\RequirePackage[english,russian]{babel}\fi}%
\else
% Russian double quotes  \< \>  ->  << >>
\def\<{{\char'372}}
\def\>{{\char'373}}
\fi
 

\@ifundefined{CYRpack}{}
{\RequirePackage{\CYRpack}}

%% The following lines contain Cyrillic text and should be transcoded
%% according to the default encoding used at your machine
\if@babel\else
\def\contentsname{Содержание}
\def\listfigurename{Список рисунков}
\def\listtablename{Список таблиц}
\def\abstractname{Аннотация}
\def\partname{Часть}
\def\chaptername{Глава}
\def\appendixname{Приложение}
\def\refname{Литература}
\def\bibname{Библиография}
\def\indexname{Алфавитный указатель}
\def\figurename{Рис.}
\def\fnum@figure{Рис.\ \thefigure}
\def\tablename{Таблица}
\def\enclname{encl}
\def\ccname{копия}
\def\headtoname{К}
\def\pagename{с.}
\def\seename{смотри}
\def\alsoname{смотри также}
\def\today{{\def\it}}
% we define today's date in European format
\def\today{\number\day\space
     \ifcase\month\or
       января\or февраля\or марта\or апреля\or мая\or июня\or
       июля\or августа\or сентября\or октября\or ноября\or декабря\fi
     \space\number\year}
\fi
% Russian number symbol
%\def\No{{\char'374}}
\endinput
