-
Notifications
You must be signed in to change notification settings - Fork 2
/
gloss-churchslavonic.ldf
265 lines (247 loc) · 9.31 KB
/
gloss-churchslavonic.ldf
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
\ProvidesFile{gloss-churchslavonic.ldf}[polyglossia: module for Church Slavonic]
\PolyglossiaSetup{churchslavonic}{
bcp47=cu,
bcp47-language=cu,
bcp47-script=Cyrl,
script=Cyrillic,
scripttag=cyrl,
langtag=CHU,
hyphennames={churchslavonic},
hyphenmins={1,2},
frenchspacing=true,
fontsetup=true
}
% if spelling is set to modern, Russian date and caption
% as well as ASCII digits are used.
\newif\ifcyrillic@numerals
\DeclareKeys[polyglossia/gloss/churchslavonic]
{
babelshorthands.if = churchslavonic@babelshorthands,
babelshorthands.default:n = true,
spelling.choice:,
spelling / modern.code =
{%
\def\captionschurchslavonic{\captionschurchslavonic@modern}%
\def\datechurchslavonic{\datechurchslavonic@modern}%
\SetLanguageKeys{churchslavonic}{bcp47=cu,bcp47-script=Cyrl}%
},
spelling / traditional.code =
{%
\def\captionschurchslavonic{\captionschurchslavonic@traditional}%
\def\datechurchslavonic{\datechurchslavonic@traditional}%
\SetLanguageKeys{churchslavonic}{bcp47=cu-Cyrs,bcp47-sript=Cyrs}%
},
spelling.default:n = modern,
numerals.choice:,
numerals / cyrillic.code =
{%
\cyrillic@numeralstrue%
\SetLanguageKeys{churchslavonic}{bcp47-extension-u=nu-cyrl}%
},
numerals / latin.code =
{%
\cyrillic@numeralsfalse%
\SetLanguageKeys{churchslavonic}{bcp47-extension-u=nu-latn}%
},
numerals.default:n = latin,
numerals/unknown.code = \xpg@warning{Unknown Church Salvonic numerals value `#1'},
}
% Register default options
\InitializeGlossOptions{churchslavonic}{babelshorthands=false,
spelling=modern,
numerals=latin}
\ifsystem@babelshorthands
\SetGlossOptions{churchslavonic}{babelshorthands=true}
\else
\SetGlossOptions{churchslavonic}{babelshorthands=false}
\fi
\InitializeBabelShorthands
\def\churchslavonic@shorthands{%
\bbl@activate{"}%
\def\language@group{churchslavonic}%
% \declare@shorthand{russian}{"`}{„}%
% \declare@shorthand{russian}{"'}{“}%
% \declare@shorthand{russian}{"<}{«}%
% \declare@shorthand{russian}{">}{»}%
\declare@shorthand{churchslavonic}{""}{\hskip\z@skip}%
\declare@shorthand{churchslavonic}{"~}{\textormath{\leavevmode\hbox{-}}{-}}%
\declare@shorthand{churchslavonic}{"=}{\nobreak-\hskip\z@skip}%
\declare@shorthand{churchslavonic}{"|}{\textormath{\nobreak\discretionary{-}{}{\kern.03em}\allowhyphens}{}}%
\declare@shorthand{churchslavonic}{"-}{%
\def\churchslavonic@sh@tmp{%
\if\churchslavonic@sh@next-\expandafter\churchslavonic@sh@emdash
\else\expandafter\churchslavonic@sh@hyphen\fi
}%
\futurelet\churchslavonic@sh@next\churchslavonic@sh@tmp}%
\def\churchslavonic@sh@hyphen{%
\nobreak\-\bbl@allowhyphens}%
\def\churchslavonic@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{churchslavonic}{",}{\nobreak\hskip.2em\ignorespaces}%
}
\def\nochurchslavonic@shorthands{%
\@ifundefined{initiate@active@char}{}{\bbl@deactivate{"}}%
}
\def\captionschurchslavonic@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\datechurchslavonic@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\captionschurchslavonic@traditional{%
\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\datechurchslavonic@traditional{%
\def\today{\number\day%
\space\ifcase\month\or%
і҆аннꙋа́рїа\or
феврꙋа́рїа\or
ма́рта\or
а҆прі́ллїа\or
ма́їа\or
і҆ꙋ́нїа\or
і҆ꙋ́лїа\or
а҆́ѵгꙋста\or
септе́мврїа\or
ѻ҆ктѡ́врїа\or
ное́мврїа\or
деке́мврїа\fi%
\space л.\space\number\year\space}}
% The following is based on some ideas from ruscor.sty
\def\churchslavonic@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\Azbuk#1{\expandafter\churchslavonic@Alph\csname c@#1\endcsname}
\def\churchslavonic@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 Ь\or Ѣ\or
Ю\or Ѫ\or Ѧ\or Ѯ\or Ѱ\or Ѳ\or Ѵ\else\xpg@ill@value{#1}{churchslavonic@Alph}\fi}
\def\azbuk#1{\expandafter\churchslavonic@alph\csname c@#1\endcsname}
\def\churchslavonic@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 ь\or ѣ\or
ю\or ѫ\or ѧ\or ѯ\or ѱ\or ѳ\or ѵ\else\xpg@ill@value{#1}{churchslavonic@alph}\fi}
%% Deleting stuff for Cyrillic numerals
%% TODO: link with cu-num package
\def\noextras@churchslavonic{%
\def\@seccntformat##1{\csname the##1\endcsname\quad}% = LaTeX kernel
\ifcyrillic@numerals\nochurchslavonic@numbers\fi
\nochurchslavonic@shorthands%
}
\def\blockextras@churchslavonic{%
\churchslavonic@capsformat%
\ifcyrillic@numerals\churchslavonic@numbers\fi
\ifchurchslavonic@babelshorthands\churchslavonic@shorthands\fi
}
\def\inlineextras@churchslavonic{%
\ifchurchslavonic@babelshorthands\churchslavonic@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