You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
377 lines
12 KiB
377 lines
12 KiB
\ProvidesFile{gloss-russian.ldf}[polyglossia: module for russian]
|
|
|
|
\RequirePackage{xpg-cyrillicnumbers}
|
|
|
|
\PolyglossiaSetup{russian}{
|
|
bcp47=ru,
|
|
script=Cyrillic,
|
|
scripttag=cyrl,
|
|
langtag=RUS,
|
|
hyphennames={russian},
|
|
hyphenmins={2,2},
|
|
frenchspacing=true,
|
|
indentfirst=true,
|
|
fontsetup,
|
|
localnumeral=russiannumerals,
|
|
Localnumeral=Russiannumerals
|
|
}
|
|
|
|
% BCP-47 compliant aliases
|
|
\setlanguagealias*{russian}{ru}
|
|
\setlanguagealias*[spelling=modern]{russian}{ru-luna1918}
|
|
\setlanguagealias*[spelling=old]{russian}{ru-petr1708}
|
|
|
|
\newif\if@russian@modern
|
|
\define@key{russian}{spelling}[modern]{%
|
|
\ifstrequal{#1}{old}%
|
|
{\@russian@modernfalse\SetLanguageKeys{russian}{bcp47=ru-petr1708}}%
|
|
{\@russian@moderntrue\SetLanguageKeys{russian}{bcp47=ru}}%
|
|
}
|
|
|
|
\def\captionsrussian{%
|
|
\if@russian@modern\captionsrussian@modern\else\captionsrussian@old\fi%
|
|
}%
|
|
|
|
\def\daterussian{%
|
|
\if@russian@modern\daterussian@modern\else\daterussian@old\fi%
|
|
}%
|
|
|
|
\newif\ifcyrillic@numerals
|
|
\newif\ifcyrillic@asbuk@numerals
|
|
\define@choicekey*+{russian}{numerals}[\xpg@val\xpg@nr]{arabic,cyrillic,cyrillic-trad,cyrillic-alph}[arabic]{%
|
|
\ifcase\xpg@nr\relax
|
|
% arabic:
|
|
\cyrillic@numeralsfalse%
|
|
\cyrillic@asbuk@numeralsfalse%
|
|
\or
|
|
% cyrillic:
|
|
\cyrillic@numeralstrue%
|
|
\cyrillic@asbuk@numeralsfalse%
|
|
\or
|
|
% cyrillic-trad:
|
|
\cyrillic@numeralstrue%
|
|
\cyrillic@asbuk@numeralsfalse%
|
|
\or
|
|
% cyrillic-alph:
|
|
\cyrillic@numeralstrue%
|
|
\cyrillic@asbuk@numeralstrue%
|
|
\fi
|
|
\xpg@info{Option: Russian, numerals=\xpg@val}%
|
|
}{\xpg@warning{Unknown Russian numerals value `#1'}}
|
|
|
|
\define@boolkey{russian}[russian@]{indentfirst}[true]{
|
|
\ifrussian@indentfirst
|
|
\SetLanguageKeys{russian}{indentfirst=true}
|
|
\else
|
|
\SetLanguageKeys{russian}{indentfirst=false}
|
|
\fi
|
|
}
|
|
|
|
\define@boolkey{russian}[russian@]{babelshorthands}[true]{}
|
|
|
|
|
|
% Register default options
|
|
\xpg@initialize@gloss@options{russian}{babelshorthands=false,spelling=modern,numerals=arabic,indentfirst=false}
|
|
|
|
|
|
\ifsystem@babelshorthands
|
|
\setkeys{russian}{babelshorthands=true}
|
|
\else
|
|
\setkeys{russian}{babelshorthands=false}
|
|
\fi
|
|
|
|
\ifcsundef{initiate@active@char}{%
|
|
\input{babelsh.def}%
|
|
\initiate@active@char{"}%
|
|
\shorthandoff{"}%
|
|
}{}
|
|
|
|
\def\russian@shorthands{%
|
|
\bbl@activate{"}%
|
|
\def\language@group{russian}%
|
|
% \declare@shorthand{russian}{"`}{„}%
|
|
% \declare@shorthand{russian}{"'}{“}%
|
|
% \declare@shorthand{russian}{"<}{«}%
|
|
% \declare@shorthand{russian}{">}{»}%
|
|
\declare@shorthand{russian}{""}{\hskip\z@skip}%
|
|
\declare@shorthand{russian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
|
|
\declare@shorthand{russian}{"=}{\nobreak-\hskip\z@skip}%
|
|
\declare@shorthand{russian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
|
|
\declare@shorthand{russian}{"-}{%
|
|
\def\russian@sh@tmp{%
|
|
\if\russian@sh@next-\expandafter\russian@sh@emdash%
|
|
\else\expandafter\russian@sh@hyphen\fi%
|
|
}%
|
|
\futurelet\russian@sh@next\russian@sh@tmp}%
|
|
\def\russian@sh@hyphen{%
|
|
\nobreak\-\bbl@allowhyphens}%
|
|
\def\russian@sh@emdash##1##2{\cdash-##1##2}%
|
|
\def\cdash##1##2##3{\def\tempx@{##3}%
|
|
\def\tempa@{-}\def\tempb@{~}\def\tempc@{*}%
|
|
\ifx\tempx@\tempa@\@Acdash\else
|
|
\ifx\tempx@\tempb@\@Bcdash\else
|
|
\ifx\tempx@\tempc@\@Ccdash\else
|
|
\errmessage{Wrong usage of cdash}\fi\fi\fi}%
|
|
\def\@Acdash{\ifdim\lastskip>\z@\unskip\nobreak\hskip.2em\fi
|
|
\cyrdash\hskip.2em\ignorespaces}%
|
|
\def\@Bcdash{\leavevmode\ifdim\lastskip>\z@\unskip\fi
|
|
\nobreak\cyrdash\penalty\exhyphenpenalty\hskip\z@skip\ignorespaces}%
|
|
\def\@Ccdash{\leavevmode
|
|
\nobreak\cyrdash\nobreak\hskip.35em\ignorespaces}%
|
|
\ifx\cyrdash\undefined
|
|
\def\cyrdash{\hbox to.8em{--\hss--}}%
|
|
\fi
|
|
\declare@shorthand{russian}{",}{\nobreak\hskip.2em\ignorespaces}%
|
|
}
|
|
|
|
\def\norussian@shorthands{%
|
|
\@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
|
|
}
|
|
|
|
|
|
\def\captionsrussian@modern{%
|
|
\def\prefacename{Предисловие}%
|
|
\def\refname{Список литературы}%
|
|
\def\abstractname{Аннотация}%
|
|
\def\bibname{Литература}%
|
|
\def\chaptername{Глава}%
|
|
\def\appendixname{Приложение}%
|
|
\ifcsundef{thechapter}%
|
|
{\def\contentsname{Содержание}}%
|
|
{\def\contentsname{Оглавление}}%
|
|
\def\listfigurename{Список иллюстраций}%
|
|
\def\listtablename{Список таблиц}%
|
|
\def\indexname{Предметный указатель}%
|
|
\def\authorname{Именной указатель}%
|
|
\def\figurename{Рис.}%
|
|
\def\tablename{Таблица}%
|
|
\def\partname{Часть}%
|
|
\def\enclname{вкл.}%
|
|
\def\ccname{исх.}%
|
|
\def\headtoname{вх.}%
|
|
\def\pagename{с.}%
|
|
\def\seename{см.}%
|
|
\def\alsoname{см.~также}%
|
|
\def\proofname{Доказательство}%
|
|
}
|
|
\def\daterussian@modern{%
|
|
\def\today{\number\day%
|
|
\space\ifcase\month\or%
|
|
января\or
|
|
февраля\or
|
|
марта\or
|
|
апреля\or
|
|
мая\or
|
|
июня\or
|
|
июля\or
|
|
августа\or
|
|
сентября\or
|
|
октября\or
|
|
ноября\or
|
|
декабря\fi%
|
|
\space \number\year\space г.}%
|
|
}
|
|
|
|
\def\captionsrussian@old{%
|
|
\def\prefacename{Предисловіе}%
|
|
\def\refname{Примѣчанія}%
|
|
\def\abstractname{Аннотація}%
|
|
\def\bibname{Библіографія}%
|
|
\def\chaptername{Глава}%
|
|
\def\appendixname{Приложеніе}%
|
|
\ifcsundef{thechapter}%
|
|
{\def\contentsname{Содержаніе}}%
|
|
{\def\contentsname{Оглавленіе}}%
|
|
\def\listfigurename{Списокъ иллюстрацій}%
|
|
\def\listtablename{Списокъ таблицъ}%
|
|
\def\indexname{Предмѣтный указатель}%
|
|
\def\authorname{Именной указатель}%
|
|
\def\figurename{Рис.}%
|
|
\def\tablename{Таблица}%
|
|
\def\partname{Часть}%
|
|
\def\enclname{вкл.}%
|
|
\def\ccname{исх.}%
|
|
\def\headtoname{вх.}%
|
|
\def\pagename{с.}%
|
|
\def\seename{см.}%
|
|
\def\alsoname{см.~также}%
|
|
\def\proofname{Доказательство}%
|
|
}
|
|
|
|
\def\daterussian@old{%
|
|
\def\today{\number\day%
|
|
\space\ifcase\month\or%
|
|
января\or
|
|
февраля\or
|
|
марта\or
|
|
апреля\or
|
|
мая\or
|
|
іюня\or
|
|
іюля\or
|
|
августа\or
|
|
сентября\or
|
|
октября\or
|
|
ноября\or
|
|
декабря\fi%
|
|
\space \number\year\space г.}%
|
|
}
|
|
|
|
% The following is based on some ideas from ruscor.sty
|
|
\def\russian@capsformat{%
|
|
\ifdef{\KOMAScript}{%
|
|
\ifdef{\chapterformat}{%
|
|
\renewcommand{\chapterformat}{\prechapter\thechapter\postchapter}}{}%
|
|
\ifdef{\sectionformat}{%
|
|
\renewcommand{\sectionformat}{\presection\thesection\postsection}}{}%
|
|
\ifdef{\subsectionformat}{%
|
|
\renewcommand{\subsectionformat}{\presubsection\thesubsection\postsubsection}}{}%
|
|
\ifdef{\subsubsectionformat}{%
|
|
\renewcommand{\subsubsectionformat}{\presubsubsection\thesubsubsection\postsubsubsection}}{}%
|
|
\ifdef{\paragraphformat}{%
|
|
\renewcommand{\paragraphformat}{\preparagraph\theparagraph\postparagraph}}{}%
|
|
\ifdef{\subparagraphformat}{%
|
|
\renewcommand{\subparagraphformat}{\presubparagraph\thesubparagraph\postsubparagraph}}{}%
|
|
}{%
|
|
\def\@seccntformat##1{\csname pre##1\endcsname%
|
|
\csname the##1\endcsname%
|
|
\csname post##1\endcsname}%
|
|
}%
|
|
\def\@aftersepkern{\hspace{0.5em}}%
|
|
\def\postchapter{.\@aftersepkern}%
|
|
\def\postsection{.\@aftersepkern}%
|
|
\def\postsubsection{.\@aftersepkern}%
|
|
\def\postsubsubsection{.\@aftersepkern}%
|
|
\def\postparagraph{.\@aftersepkern}%
|
|
\def\postsubparagraph{.\@aftersepkern}%
|
|
\def\prechapter{}%
|
|
\def\presection{}%
|
|
\def\presubsection{}%
|
|
\def\presubsubsection{}%
|
|
\def\preparagraph{}%
|
|
\def\presubparagraph{}%
|
|
}
|
|
|
|
\newcommand{\russiannumerals}[2]{\russiannumber{#2}}
|
|
\newcommand{\Russiannumerals}[2]{\Russiannumber{#2}}
|
|
|
|
\def\russiannumber#1{%
|
|
\ifcyrillic@numerals
|
|
\ifcyrillic@asbuk@numerals
|
|
\russian@asbuk@alph{#1}%
|
|
\else
|
|
\cyr@alph{#1}%
|
|
\fi
|
|
\else
|
|
\number#1%
|
|
\fi%
|
|
}
|
|
|
|
\def\Russiannumber#1{%
|
|
\ifcyrillic@numerals
|
|
\ifcyrillic@asbuk@numerals
|
|
\russian@asbuk@Alph{#1}%
|
|
\else
|
|
\cyr@Alph{#1}%
|
|
\fi
|
|
\else
|
|
\number#1%
|
|
\fi%
|
|
}
|
|
|
|
\let\russiannumeral=\russiannumber
|
|
\let\Russiannumeral=\Russiannumber
|
|
|
|
\def\Asbuk#1{\expandafter\russian@asbuk@Alph\csname c@#1\endcsname}
|
|
\def\asbuk#1{\expandafter\russian@asbuk@alph\csname c@#1\endcsname}
|
|
|
|
\def\AsbukTrad#1{\expandafter\cyr@Alph\csname c@#1\endcsname}
|
|
\def\asbukTrad#1{\expandafter\cyr@alph\csname c@#1\endcsname}
|
|
|
|
|
|
% This is a poor man's cyrillic alphanumeric. It just uses the alphabet and
|
|
% thus ends at 30.
|
|
\def\russian@asbuk@Alph#1{\ifcase#1\or
|
|
А\or Б\or В\or Г\or Д\or Е\or Ж\or
|
|
З\or И\or К\or Л\or М\or Н\or О\or
|
|
П\or Р\or С\or Т\or У\or Ф\or Х\or
|
|
Ц\or Ч\or Ш\or Щ\or Э\or Ю\or Я%
|
|
\else\xpg@ill@value{#1}{russian@asbuk@Alph}\fi%
|
|
}
|
|
|
|
\def\russian@asbuk@alph#1{\ifcase#1\or
|
|
а\or б\or в\or г\or д\or е\or ж\or
|
|
з\or и\or к\or л\or м\or н\or о\or
|
|
п\or р\or с\or т\or у\or ф\or х\or
|
|
ц\or ч\or ш\or щ\or э\or ю\or я%
|
|
\else\xpg@ill@value{#1}{russian@asbuk@alph}\fi%
|
|
}
|
|
|
|
\def\russian@numbers{%
|
|
\let\latin@alph\@alph
|
|
\let\latin@Alph\@Alph
|
|
\ifcyrillic@numerals%
|
|
\def\russian@alph##1{\expandafter\russiannumeral\expandafter{\the##1}}%
|
|
\def\russian@Alph##1{\expandafter\Russiannumeral\expandafter{\the##1}}%
|
|
\let\@alph\russian@alph%
|
|
\let\@Alph\russian@Alph%
|
|
\fi
|
|
}
|
|
|
|
\def\norussian@numbers{%
|
|
\let\@alph\latin@alph%
|
|
\let\@Alph\latin@Alph%
|
|
}
|
|
|
|
\def\noextras@russian{%
|
|
\ifdef{\KOMAScript}{%
|
|
\ifdef{\chapterformat}{%
|
|
\renewcommand{\chapterformat}{\thechapter\autodot\enskip}}{}%
|
|
\ifdef{\sectionformat}{%
|
|
\renewcommand{\sectionformat}{\thesection\autodot\enskip}}{}%
|
|
\ifdef{\subsectionformat}{%
|
|
\renewcommand{\subsectionformat}{\thesubsection\autodot\enskip}}{}%
|
|
\ifdef{\subsubsectionformat}{%
|
|
\renewcommand{\subsubsectionformat}{\thesubsubsection\autodot\enskip}}{}%
|
|
\ifdef{\paragraphformat}{%
|
|
\renewcommand{\paragraphformat}{\theparagraph\autodot\enskip}}{}%
|
|
\ifdef{\subparagraphformat}{%
|
|
\renewcommand{\subparagraphformat}{\thesubparagraph\autodot\enskip}}{}%
|
|
}{%
|
|
\def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel
|
|
}%
|
|
\ifcyrillic@numerals\norussian@numbers\fi%
|
|
\norussian@shorthands%
|
|
}
|
|
|
|
\def\blockextras@russian{%
|
|
\russian@capsformat%
|
|
\ifcyrillic@numerals\russian@numbers\fi%
|
|
\ifrussian@babelshorthands\russian@shorthands\fi%
|
|
}
|
|
|
|
\def\inlineextras@russian{%
|
|
\ifrussian@babelshorthands\russian@shorthands\fi%
|
|
}
|
|
|
|
%%% These lines taken from russianb.ldf, part of babel package.
|
|
% make it optional?
|
|
\def\sh {\mathop{\operator@font sh}\nolimits}
|
|
\def\ch {\mathop{\operator@font ch}\nolimits}
|
|
\def\tg {\mathop{\operator@font tg}\nolimits}
|
|
\def\arctg {\mathop{\operator@font arctg}\nolimits}
|
|
\def\arcctg{\mathop{\operator@font arcctg}\nolimits}
|
|
\def\th {\mathop{\operator@font th}\nolimits}
|
|
\def\ctg {\mathop{\operator@font ctg}\nolimits}
|
|
\def\cth {\mathop{\operator@font cth}\nolimits}
|
|
\def\cosec {\mathop{\operator@font cosec}\nolimits}
|
|
\def\Prob {\mathop{\kern\z@\mathsf{P}}\nolimits}
|
|
\def\Variance{\mathop{\kern\z@\mathsf{D}}\nolimits}
|
|
\def\nod {\mathop{\mathrm{н.о.д.}}\nolimits}
|
|
\def\nok {\mathop{\mathrm{н.о.к.}}\nolimits}
|
|
\def\NOD {\mathop{\mathrm{НОД}}\nolimits}
|
|
\def\NOK {\mathop{\mathrm{НОК}}\nolimits}
|
|
\def\Proj {\mathop{\mathrm{Пр}}\nolimits}
|
|
%\DeclareRobustCommand{\No}{№}
|
|
|
|
\endinput
|
|
|
|
|