summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/polyglossia/gloss-ukrainian.ldf
blob: a0d1d3c3fc0ab201379a9d87b228e09cbc927439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
\ProvidesFile{gloss-ukrainian.ldf}[polyglossia: module for ukrainian]
% Strings taken from Babel
% and revised by Roman Kyrylych

\PolyglossiaSetup{ukrainian}{
  script=Cyrillic,
  scripttag=cyrl,
  langtag=UKR,
  hyphennames={ukrainian},
  hyphenmins={2,2},
  frenchspacing=true,
  fontsetup=true
  %TODO localalph
}

\newif\ifcyrillic@numerals
\define@key{ukrainian}{numerals}[latin]{%
\ifstrequal{#1}{cyrillic}%
{\cyrillic@numeralstrue}
{\cyrillic@numeralsfalse}%
}

\define@boolkey{ukrainian}[ukrainian@]{babelshorthands}[false]{}

\setkeys{ukrainian}{numerals}

\ifsystem@babelshorthands
\setkeys{ukrainian}{babelshorthands=true}
\else
\setkeys{ukrainian}{babelshorthands=false}
\fi

\ifcsundef{initiate@active@char}{%
  \input{babelsh.def}%
  \initiate@active@char{"}%
  \shorthandoff{"}%
}{}

\def\ukrainian@shorthands{%
\bbl@activate{"}%
\def\language@group{ukrainian}%
%  \declare@shorthand{ukrainian}{"`}{„}%
%  \declare@shorthand{ukrainian}{"'}{“}%
%  \declare@shorthand{ukrainian}{"<}{«}%
%  \declare@shorthand{ukrainian}{">}{»}%
\declare@shorthand{ukrainian}{""}{\hskip\z@skip}%
\declare@shorthand{ukrainian}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
\declare@shorthand{ukrainian}{"=}{\nobreak-\hskip\z@skip}%
\declare@shorthand{ukrainian}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
\declare@shorthand{ukrainian}{"-}{%
\def\ukrainian@sh@tmp{%
\if\ukrainian@sh@next-\expandafter\ukrainian@sh@emdash
\else\expandafter\ukrainian@sh@hyphen\fi
}%
\futurelet\ukrainian@sh@next\ukrainian@sh@tmp}%
\def\ukrainian@sh@hyphen{%
\nobreak\-\bbl@allowhyphens}%
\def\ukrainian@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{ukrainian}{",}{\nobreak\hskip.2em\ignorespaces}%
}

\def\noukrainian@shorthands{%
\@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
}

\def\captionsukrainian{%
   \def\refname{Література}%
   \def\abstractname{Анотація}%
   \def\bibname{Бібліоґрафія}%
   \def\prefacename{Вступ}%
   \def\chaptername{Розділ}%
   \def\appendixname{Додаток}%
   \def\contentsname{Зміст}%
   \def\listfigurename{Перелік ілюстрацій}%
   \def\listtablename{Перелік таблиць}%
   \def\indexname{Покажчик}%
   \def\authorname{Іменний покажчик}% babel has "Їменний покажчик"
   \def\figurename{Рис.}%
   \def\tablename{Табл.}%
   %\def\thepart{}%
   \def\partname{Частина}%
   \def\pagename{с.}%
   \def\seename{див.}%
   \def\alsoname{див.\ також}%
   \def\enclname{вкладка}%
   \def\ccname{копія}%
   \def\headtoname{До}%
   \def\proofname{Доведення}%
   \def\glossaryname{Словник термінів}%
   }
\def\dateukrainian{%
   \def\today{\number\day~\ifcase\month\or
    січня\or
    лютого\or
    березня\or
    квітня\or
    травня\or
    червня\or
    липня\or
    серпня\or
    вересня\or
    жовтня\or
    листопада\or
    грудня\fi%
    \space\number\year~р.}}

% The following is based on some ideas from ruscor.sty
\def\ukrainian@capsformat{%
\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{}}

\def\Asbuk#1{\expandafter\ukrainian@Alph\csname c@#1\endcsname}
\def\ukrainian@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 Ш\or Щ\or Ю\or Я\else\xpg@ill@value{#1}{ukrainian@Alph}\fi}
\def\asbuk#1{\expandafter\ukrainian@alph\csname c@#1\endcsname}
\def\ukrainian@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 ш\or щ\or ю\or я\else\xpg@ill@value{#1}{ukrainian@alph}\fi}

\def\ukrainian@numbers{%
   \let\@Alph\ukrainian@Alph%
   \let\@alph\ukrainian@alph%
}

\def\noukrainian@numbers{%
   \let\@Alph\latin@Alph%
   \let\@alph\latin@alph%
}

\def\noextras@ukrainian{%
\def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel
\ifcyrillic@numerals\noukrainian@numbers\fi
\noukrainian@shorthands%
}

\def\blockextras@ukrainian{%
\ukrainian@capsformat%
\ifcyrillic@numerals\ukrainian@numbers\fi
\ifukrainian@babelshorthands\ukrainian@shorthands\fi
}

\def\inlineextras@ukrainian{%
\ifukrainian@babelshorthands\ukrainian@shorthands\fi%
}

%%% stuff from Babel
% 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\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\nsd{\mathop{\mathrm{н.с.д.}}\nolimits}
\def\nsk{\mathop{\mathrm{н.с.к.}}\nolimits}
\def\NSD{\mathop{\mathrm{НСД}}\nolimits}
\def\NSK{\mathop{\mathrm{НСК}}\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}

\endinput