summaryrefslogtreecommitdiff
path: root/language/churchslavonic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /language/churchslavonic
Initial commit
Diffstat (limited to 'language/churchslavonic')
-rw-r--r--language/churchslavonic/LICENSE9
-rw-r--r--language/churchslavonic/README62
-rw-r--r--language/churchslavonic/churchslavonic-en.pdfbin0 -> 101860 bytes
-rw-r--r--language/churchslavonic/churchslavonic-en.tex32
-rw-r--r--language/churchslavonic/churchslavonic-ru.pdfbin0 -> 77115 bytes
-rw-r--r--language/churchslavonic/churchslavonic-ru.tex32
-rw-r--r--language/churchslavonic/churchslavonic.sty40
-rw-r--r--language/churchslavonic/churchslavonic.tex768
-rw-r--r--language/churchslavonic/cu-calendar.sty182
-rw-r--r--language/churchslavonic/cu-kinovar.sty41
-rw-r--r--language/churchslavonic/cu-num.sty341
-rw-r--r--language/churchslavonic/cu-util.sty196
-rw-r--r--language/churchslavonic/gloss-churchslavonic.ldf245
13 files changed, 1948 insertions, 0 deletions
diff --git a/language/churchslavonic/LICENSE b/language/churchslavonic/LICENSE
new file mode 100644
index 0000000000..18ca1a93c7
--- /dev/null
+++ b/language/churchslavonic/LICENSE
@@ -0,0 +1,9 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Aleksandr Andreev and Mike Kroutikov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/language/churchslavonic/README b/language/churchslavonic/README
new file mode 100644
index 0000000000..c9c209fcdf
--- /dev/null
+++ b/language/churchslavonic/README
@@ -0,0 +1,62 @@
+churchslavonic
+==============
+
+LaTeX package to typeset documents in Church Slavonic language (also known as Church Slavic
+and Old Church Slavonic), ISO 639-1 code "cu". Includes hyphenation patterns,
+fonts, polyglossia driver, and supporting macros.
+
+Only Unicode input encoding is supported. This package requires use of a modern TeX engine that supports
+Unicode, such as XeTeX or LuaTeX.
+
+Changelog
+---------
+
+v0.2.1 2016.12.18 - gloss file included in CTAN package
+v0.2 2016.10.23 - new macrocommands and docs
+v0.1 2016.05.10 - first draft release
+
+Installation
+------------
+
+ tlmgr install churchslavonic
+
+
+Dependencies
+------------
+
+tlmgr handles dependencies transparently and required packages will be automatically pulled in - no need to do
+anything else.
+
+The following information is only needed if you do not use tlmgr and install churchslavonic package by directly
+downloading it from CTAN.
+
+Dependencies:
+
+* hyphen-churchslavonic
+* fonts-churchslavonic
+* intcalc
+* etoolbox
+* xcolor
+
+Support
+-------
+
+For bug reports and support questions, please use GitHub issue tracker:
+
+ https://github.com/slavonic/cu-tex/issues
+
+GitHub url
+----------
+
+ https://github.com/slavonic/cu-tex
+
+Authors and maintainers
+-----------------------
+
+Mike Kroutikov <pgmmpk@gmail.com>.
+Aleksandr Andreev <aleksandr.andreev@gmail.com>.
+
+License
+-------
+
+MIT
diff --git a/language/churchslavonic/churchslavonic-en.pdf b/language/churchslavonic/churchslavonic-en.pdf
new file mode 100644
index 0000000000..03d3397cdf
--- /dev/null
+++ b/language/churchslavonic/churchslavonic-en.pdf
Binary files differ
diff --git a/language/churchslavonic/churchslavonic-en.tex b/language/churchslavonic/churchslavonic-en.tex
new file mode 100644
index 0000000000..d26a965055
--- /dev/null
+++ b/language/churchslavonic/churchslavonic-en.tex
@@ -0,0 +1,32 @@
+%
+% The MIT License (MIT)
+%
+% Copyright (c) 2016 Aleksandr Andreev and Mike Kroutikov
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy of this
+% software and associated documentation files (the "Software"), to deal in the Software
+% without restriction, including without limitation the rights to use, copy, modify,
+% merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
+% permit persons to whom the Software is furnished to do so, subject to the following
+% conditions:
+%
+% The above copyright notice and this permission notice shall be included in all copies or
+% substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+% INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+% PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+% LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
+% OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+% OTHER DEALINGS IN THE SOFTWARE.
+%
+\documentclass[11pt]{article}
+\usepackage{comment}
+ \includecomment{EN}
+ \excludecomment{RU}
+\usepackage{polyglossia}
+ \setmainlanguage{english}
+ \setotherlanguage{russian}
+ \setotherlanguage{churchslavonic}
+
+\input churchslavonic.tex
diff --git a/language/churchslavonic/churchslavonic-ru.pdf b/language/churchslavonic/churchslavonic-ru.pdf
new file mode 100644
index 0000000000..fd446bd875
--- /dev/null
+++ b/language/churchslavonic/churchslavonic-ru.pdf
Binary files differ
diff --git a/language/churchslavonic/churchslavonic-ru.tex b/language/churchslavonic/churchslavonic-ru.tex
new file mode 100644
index 0000000000..433cbac109
--- /dev/null
+++ b/language/churchslavonic/churchslavonic-ru.tex
@@ -0,0 +1,32 @@
+%
+% The MIT License (MIT)
+%
+% Copyright (c) 2016 Aleksandr Andreev and Mike Kroutikov
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy of this
+% software and associated documentation files (the "Software"), to deal in the Software
+% without restriction, including without limitation the rights to use, copy, modify,
+% merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
+% permit persons to whom the Software is furnished to do so, subject to the following
+% conditions:
+%
+% The above copyright notice and this permission notice shall be included in all copies or
+% substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+% INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+% PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+% LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
+% OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+% OTHER DEALINGS IN THE SOFTWARE.
+%
+\documentclass[11pt]{article}
+\usepackage{comment}
+ \includecomment{RU}
+ \excludecomment{EN}
+\usepackage{polyglossia}
+ \setmainlanguage{russian}
+ \setotherlanguage{english}
+ \setotherlanguage{churchslavonic}
+
+\input churchslavonic.tex
diff --git a/language/churchslavonic/churchslavonic.sty b/language/churchslavonic/churchslavonic.sty
new file mode 100644
index 0000000000..4b0f5a106a
--- /dev/null
+++ b/language/churchslavonic/churchslavonic.sty
@@ -0,0 +1,40 @@
+% Copyright 2016 Slavonic Computing Initiative
+% http://sci.ponomar.net
+%
+\ProvidesPackage{churchslavonic}[2016/04/19 v0.2 Typesetting in Church Slavonic]
+
+\DeclareOption*{
+ \PassOptionsToPackage{\CurrentOption}{cu-kinovar}
+}
+\ProcessOptions\relax
+
+\RequirePackage{cu-num}
+\RequirePackage{cu-calendar}
+\RequirePackage{cu-util}
+\RequirePackage{cu-kinovar}
+
+% underscore is a valid character in Church Slavonic
+\let\cu@oldunderscore=_
+\catcode`\_\active
+\protected\def_{\ifmmode\cu@oldunderscore\else\textunderscore\discretionary{}{}{}\fi}
+
+% suppress variable distance between lines
+\lineskiplimit -1ex
+
+% margin marks
+\def\cu@mmark@counter{0}%
+\def\cuMarginMarkSkip{0.6em}%
+\def\cuMarginMarkText#1{#1}%
+\protected\def\cuMarginMark#1{%
+\leavevmode
+\global\edef\cu@mmark@counter{\the\numexpr 1 + \cu@mmark@counter}%
+\label{mnote.\cu@mmark@counter}%
+\ifodd\getpagerefnumber{mnote.\cu@mmark@counter}\relax
+ \vadjust{\hbox{\vbox to 0pt{\vss\hbox to 0pt{\hskip\textwidth\hskip\cuMarginMarkSkip \cuMarginMarkText{#1}\hss}\vskip 0.25\baselineskip}}}%
+\else
+ \vadjust{\hbox{\vbox to 0pt{\vss\hbox to 0pt{\hss \cuMarginMarkText{#1}\hskip\cuMarginMarkSkip}\vskip 0.25\baselineskip}}}%
+\fi
+}%
+
+
+\endinput
diff --git a/language/churchslavonic/churchslavonic.tex b/language/churchslavonic/churchslavonic.tex
new file mode 100644
index 0000000000..deba6f79ea
--- /dev/null
+++ b/language/churchslavonic/churchslavonic.tex
@@ -0,0 +1,768 @@
+\newfontfamily\russianfont[Script=Cyrillic,Ligatures=TeX]{Linux Libertine O}
+\newfontfamily\russianfonttt[Ligatures=TeX]{lmmono10-regular.otf}
+\newfontfamily\russianfontsf[Ligatures=TeX]{lmsans10-regular.otf}
+\newfontfamily\churchslavonicfont[Script=Cyrillic,Ligatures=TeX,HyphenChar=_]{PonomarUnicode.otf}
+
+\usepackage{churchslavonic}
+\usepackage{hyperref}
+\usepackage{xltxtra}
+\usepackage{doc}
+\usepackage{lettrine}
+
+\def\pkg#1{\textsf{#1}}
+\def\cs#1{\texttt{\textbackslash #1}}
+%
+\cuDefineDateFormat{long}{%
+ \cuDayName{\cuDOW},
+ \cuNum{\cuDAY}_гѡ~%
+ \cuMonthName{\cuMONTH},~%
+ лѣ́та ѿ сотворе́нїѧ мі́ра~\cuNum{\cuYEARAM}%
+}
+%
+\makeatletter
+\def\cu@lettrine{\lettrine[lines=3,findent=0pt,nindent=0pt]}
+\def\cuLettrine{\cu@tokenizeletter\cu@lettrine}
+\renewcommand{\LettrineFontHook}{\cuKinovarColor}
+\makeatother
+
+\begin{document}
+
+\begin{EN}
+\title{\pkg{churchslavonic} package --- Church Slavonic Typography in \LaTeX}
+\author{Aleksandr Andreev and Mike Kroutikov\\version~0.2}
+\end{EN}
+
+\begin{RU}
+\title{Пакет \pkg{churchslavonic} --- верстка церковнославянских текстов в системе \LaTeX}
+\author{Александр Андреев и Михаил Крутиков\\версия~0.2}
+\end{RU}
+
+\date{\today}
+\maketitle
+
+\begin{EN}
+\begin{abstract}
+Package \pkg{churchslavonic} provides fonts, hyphenation patterns and supporting macros to typeset
+Church Slavonic texts.
+\end{abstract}
+\end{EN}
+
+\begin{RU}
+\begin{abstract}
+Пакет \pkg{churchslavonic} позволяет верстать церковнославянские документы. В пакет включены шаблоны переносов,
+шрифты и набор необходимых макрокоманд.
+\end{abstract}
+\end{RU}
+
+\tableofcontents
+
+\begin{EN}
+\section*{Introduction}
+Church Slavonic (also called Church Slavic, Old Church Slavonic
+or Old Slavonic; ISO 639-2 code \texttt{cu}) is a literary language used by
+the Slavic peoples; presently it is used as a liturgical language by the
+Russian Orthodox Church, other local Orthodox Churches, as well
+as various Byzantine-Rite Catholic and Old Ritualist communities.
+The package \texttt{churchslavonic} provides fonts, hyphenation
+patterns and supporting macros to typeset
+Church Slavonic texts in \TeX{}.
+
+The package is designed to support Unicode text encoded in UTF-8.
+Texts encoded in legacy codepages (such as HIP and UCS) may be
+converted to Unicode using a separate bundle of utilities.
+See the \href{http://sci.ponomar.net/}
+{Slavonic Computing Initiative website} for more information.
+To use the tools in this package, you will need a Unicode-aware \TeX{}
+engine such as \XeTeX{} or \LuaTeX{}.
+\end{EN}
+
+\begin{RU}
+\section*{Введение}
+Церковнославянский язык (ISO 639-2 код \texttt{cu}) --
+древний литературный язык славянских народов,
+который теперь используется в основном как богослужебный язык
+в Русской Православной Церкви, других поместных православных
+церквях, а также в грекокатолических и старообрядческих общинах.
+Пакет \pkg{churchslavonic} позволяет верстать церковнославянские тексты
+в системе \TeX{}. В пакет включены шаблоны переносов,
+шрифты и набор необходимых макрокоманд.
+
+Данный пакет поддерживает только набор в стандарте Юникод.
+Тексты, набранные в устаревших кодировках HIP и UCS,
+можно конвертировать в Юникод (точнее -- в UTF-8) с помощью
+отдельных утилит, которые можно найти на сайте
+\href{http://sci.ponomar.net/}
+{Инициативной группы славянской информатики}.
+Для того, чтобы использовать возможности этого пакета Вам
+понадобится система верстки \TeX{}, поддерживающая Юникод,
+например, \XeTeX{} или \LuaTeX{}.
+\end{RU}
+
+\begin{EN}
+\section{How to use the package}
+To use the \pkg{churchslavonic} package one needs to include the following
+declarations into the document preamble:
+\end{EN}
+
+\begin{RU}
+\section{Как пользоваться пакетом}
+Добавьте следующие определения в преамбулу вашего документа:
+\end{RU}
+
+\begin{verbatim}
+\usepackage{polyglossia}
+\setmainlanguage{churchslavonic}
+\usepackage{churchslavonic}
+\end{verbatim}
+
+\begin{EN}
+This makes the Church Slavonic hyphenation patterns immediately available.
+After that, use the standard \pkg{polyglossia} commands to control current language.
+Church Slavonic fonts are provided by the \pkg{fonts-churchslavonic} package,
+which should have been installed automatically when you installed this package.
+See the \pkg{fonts-churchslavonic} documentation for information about fonts.
+\end{EN}
+
+\begin{RU}
+Сразу станут доступны церковнославянские шаблоны переноса строки.
+После чего переключайтесь между языками стандартными средствами пакета \pkg{polyglossia}.
+Церковнославянские шритфы предоставлены в отдельном пакете \pkg{fonts-churchslavonic},
+который должен был установиться когда вы установили этот пакет.
+Подробности о шрифтах смотрите в документации к пакету \pkg{fonts-churchslavonic}.
+\end{RU}
+
+\begin{EN}
+\subsection{Options \texttt{color}, \texttt{gray} (= \texttt{grey}), and \texttt{bw}}
+These options control what color is actually being used for text coloring commands like \cs{cuKinovar}.
+
+\begin{itemize}
+\item \texttt{color} this is the default option; it indicates the original color (a shade of red).
+\item \texttt{gray} (\texttt{grey}) replaces the red color with gray - useful if you are printing on media that
+ does not support color, but is capable of grayscale.
+\item \texttt{bw} replaces the red color with black (effectively turning off
+commands like \cs{cuKinovar} and \cs{cuKinovarColor}). Use
+ this option to generate a document that will be printed in black-and-white.
+\end{itemize}
+Example:
+\end{EN}
+
+\begin{RU}
+\subsection{Опции \texttt{color}, \texttt{gray} (= \texttt{grey}) и \texttt{bw}}
+Опции позволяют отключать цвет раскраски текста в командах типа \cs{cuKinovar}.
+Полезны для создания версий для печати на
+устройствах, которые не поддерживают цветности.
+
+\begin{itemize}
+\item \texttt{color} эта опция используется по умолчанию и означает,
+что используется нормальный красный цвет.
+\item \texttt{gray} (\texttt{grey}) заменяет красный цвет серым --- используйте эту опцию если
+ваше устройство печати не поддерживает цветности, но может качественно передавать градации серого цвета.
+\item \texttt{bw} отключает всякую раскраску --- используйте для создания черно-белой версии документа.
+\end{itemize}
+Пример:
+\end{RU}
+
+\begin{verbatim}
+\usepackage[gray]{churchslavonic}
+\end{verbatim}
+
+\begin{EN}
+\subsection{Underscore}
+The underscore symbol (\texttt{\textunderscore}, U+005F \textsc{Low Line})
+ is a valid text symbol in Church Slavonic (it has roughly the same role
+as the hyphen in English). The package \pkg{churchslavonic} redefines the
+underscore in a way that it can be directly entered in text mode, for example:
+\end{EN}
+%
+\begin{RU}
+\subsection{Знак подчеркивания}
+Знак подчеркивания (\texttt{\textunderscore}, U+005F \textsc{Low Line}))
+в церковнославянском языке играет примерно ту же роль, что и дефис в русском.
+Пакет \pkg{churchslavonic} переопределяет знак подчеркивания так, что его можно
+набирать и в текстовой моде, например:
+\end{RU}
+%
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}{l}
+Послѣ́дованїе моле́бнагѡ пѣ́нїѧ ст҃ы̑мъ мч҃камъ к҃_гѡ вѣ́ка, \\
+въ Са́нктъ_Петербꙋ́ржстѣй дꙋхо́внѣй а҆каде́мїи \\
+нача̑льствовавшимъ, ᲂу҆чи̑вшимъ и҆ ᲂу҆чи̑вшимсѧ \\
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+\begin{EN}
+\cuKinovar{Attention:} if you have an older version of the \pkg{fontspec} package installed on your system,
+the redefined underscore symbol cannot be used in font names and font options in \pkg{fontspec} commands like
+\cs{setXXXfont} and \cs{newfontfamily}.
+
+Typically you need to set underscore as the hyphenation character for Church Slavonic fonts: \texttt{HyphenChar=_}.
+With older versions of \pkg{fontspec} this will cause errors. This problem exists in \TeX\ \texttt{Live 2013} and in \pkg{fontspec v2.3c}.
+
+We recommend upgrading your \TeX\ distribution to at least \TeX\ \texttt{Live 2015}. Alternatively you can selectively
+upgrade the \pkg{fontspec} package to version \texttt{v2.4c} or better.
+
+If upgrading is not an option, you can work around this problem by either specifying the hexadecimal code for the hyphenation
+character: \texttt{HyphenChar="005F}, or by declaring all fonts before loading \pkg{churchslavonic}.
+\end{EN}
+
+\begin{RU}
+\cuKinovar{Внимание:} если у вас установлена старая версия пакета \pkg{fontspec},
+переопределенный знак подчеркивания нельзя использовать при задании имен и параметров шрифтов в командах \pkg{fontspec} типа
+\cs{setXXXfont} и \cs{newfontfamily}.
+
+Обычно для церковнославянских шрифтов требуется установить подчеркивание как символ переноса, указав параметр:
+\texttt{HyphenChar=_}. Старые версии \pkg{fontspec} выдадут ошибку.
+Эта проблема присутствует в \TeX\ \texttt{Live 2013} и в \pkg{fontspec v2.3c}.
+
+Мы рекомендуем обновить систему \TeX\ до \TeX\ \texttt{Live 2015} или свежее.
+Или же обновить только пакет \pkg{fontspec} до
+версии \texttt{2.4c} или более новой.
+
+Если же вы не можете установить обновления, то можно
+обойти проблему, указав символ переноса как код в шестнадцатиричном представлении:
+\texttt{HyphenChar="005F}. Другой подход --- это декларировать все шрифты до загрузки пакета \pkg{churchslavonic}.
+\end{RU}
+
+\begin{EN}
+\section{Numbers}
+
+The Church Slavonic numbering system (Cyrillic numerals)
+is based on Greek Ionian numerals and uses letters as digits.
+For more information on the implementation, consult the appropriate section of \cite{UN41}.
+\end{EN}
+
+\begin{RU}
+\section{Числа}
+Способ записи чисел в церковнославянском языке (кириллическая цифирь)
+основывается на древнегреческом и в
+качестве цифр использует буквы.
+За подробностями отсылаем интересующегося читателя к
+соответствующей главе \cite{UN41}.
+\end{RU}
+
+\begin{EN}
+\subsection{\cs{cuNum}}
+Use this command to typeset a Cyrillic numeral.
+The command takes a single argument that should expand to a number.
+\end{EN}
+
+\begin{RU}
+\subsection{\cs{cuNum}}
+Команда печатает число кириллической цифирью.
+Она принимает единственный аргумент. Аргументом может быть текст или
+командная последовательность. Единственное условие --- аргумент должен раскрыться в число.
+\end{RU}
+
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}{| l | l |}
+\hline
+\verb+\cuNum{1}+ & \cuNum{1} \\
+\verb+\cuNum{12}+ & \cuNum{12} \\
+\verb+\cuNum{123}+ & \cuNum{123} \\
+\verb+\cuNum{1234}+ & \cuNum{1234} \\
+\verb+\cuNum{10345}+ & \cuNum{10345} \\
+\verb+\cuNum{12345}+ & \cuNum{12345} \\
+\verb+\cuNum{123456}+ & \cuNum{123456} \\
+\verb+\cuNum{800456}+ & \cuNum{800456} \\
+\verb+\cuNum{1234567}+ & \cuNum{1234567} \\
+\verb+\cuNum{1500567}+ & \cuNum{1500567} \\
+\verb+\cuNum{12345678}+ & \cuNum{12345678} \\
+\verb+\cuNum{123456789}+ & \cuNum{123456789} \\
+\hline
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+
+\begin{EN}
+\section{Dates}
+\end{EN}
+
+\begin{RU}
+\section{Даты}
+\end{RU}
+
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}[]{ | l | l | }
+\hline
+\verb+\cuDate{2016-4-21}+ & \cuDate{2016-4-21} \\
+\verb+\cuDateJulian{2016-4-21}+ & \cuDateJulian{2016-4-21} \\
+\verb+\cuDate{\cuToday}+ & \cuDate{\cuToday} \\
+\hline
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+\begin{EN}
+\subsection{\cs{cuDate}}
+This command formats the date (according to the current format).
+The argument is a triplet of numbers \texttt{YYYY-MM-DD} specifying
+the date. The output will be something like this: \textchurchslavonic{\cuDate{2016-04-22}}.
+
+Note that \texttt{YYYY-MM-DD} values are not being normalized or interpreted in any way. Thus, it is totally fine to
+call \verb+\cuDate{2016-4-32}+ even though April 32 is not a valid date. It will be formatted and printed as April 32. This
+makes it possible to use this macro in a phrase like ``the date \verb+\cuDate{2016-4-32}+ is not a valid date in any calendar''.
+
+However, if your date format uses \cs{cuDOW} (day of the week) or \cs{cuYEARAM} (year Anno Mundi), the later quantities are computed by
+interpreting the date as a Gregorian calendar date. In this case, if the input date is not a valid date, it will be normalized via extrapolation.
+For example, April 32 will be interpreted as May 2 for the purpose of determining values of the day of the week and year Anno Mundi.
+
+If your format uses \cs{cuDOW} or \cs{cuYEARAM}, and you specify a date according to the Julian, not Gregorian, calendar, you must use \cs{cuDateJulian} to
+correctly format days of the week and year Anno Mundi.
+
+The best practice is to always use \cs{cuDate} with Gregorian calendar dates and use \cs{cuDateJulian} with Julian calendar dates regardless
+of the current date format. This way you can switch the date formatting style without worrying about getting the wrong output.
+
+\subsection{\cs{cuDateJulian}}
+Formats the date, just like \cs{cuDate} does, but the argument is interpreted as a date on the Julian calendar (``old style'') instead of the Gregorian calendar.
+This makes a difference only if your format is using symbolic names \cs{cuDOW} and/or \cs{cuYEARAM}.
+\end{EN}
+
+\begin{RU}
+
+\subsection{\cs{cuDate}}
+Команда форматирует дату (в соответствии с текущим форматом). Аргумент должен иметь вид \texttt{YYYY-MM-DD}. Результат
+может выглядеть примерно так: \textchurchslavonic{\cuDate{2016-04-22}}.
+
+Отметим, что значение даты никоем образом не интерпретируется и не нормализируется. Поэтому можно вызывать макрокоманду и с
+невозможными датами, например 32 апреля --- такая дата будет отформатирована как 32 апреля. Так что команду \cs{cuDate} можно
+использовать для набора фраз вроде ``дата \verb+\cuDate{2016-04-32}+ не существует ни в одном календаре''.
+
+Однако, если вы используете свой формат даты и в этом формате задействованы символические переменные \cs{cuDOW} (день недели)
+или \cs{cuYEARAM} (год от сотворения мира), то значения этих переменных будут вычислены исходя из заданной даты --- и дата интерпретируется
+как дата по григорианскому календарю (<<новому стилю>>). В этом случае, невозможные даты будут нормализованы методом экстраполяции. Например, 32 апреля
+будет интерпретировано как 2 мая для целей определения дня недели и года от сотворения мира.
+
+Если ваш формат использует день недели (\cs{cuDOW}) или год от сотворения мира (\cs{cuYEARAM}), и вы указываете дату по юлианскому календарю (<<старому стилю>>),
+вы должны вместо \cs{cuDate} пользоваться макрокомандой \cs{cuDateJulian} для правильной обработки дня недели и года от сотворения мира.
+
+Лучше всего всегда использовать \cs{cuDate} для форматирования дат по григорианскому календарю и всегда использовать \cs{cuDateJulian} для
+форматирования дат по юлианскому календарю --- вне зависимости от значения текущего формата. Таким образом вы можете впоследствии изменить
+формат даты (например, добавив в него день недели) и результат останется правильным.
+
+\subsection{\cs{cuDateJulian}}
+Форматирует дату в соответствии с текущим форматом подобно команде \cs{cuDate}. Отличие заключается в том, что аргумент
+интерпретируется как дата по юлианскому, а не григорианскому календарю. Это имеет значение только если текущий формат даты
+использует символические имена \cs{cuDOW} (день недели) или \cs{cuYEARAM} (год от сотворения мира).
+\end{RU}
+
+\begin{EN}
+\subsection{\cs{cuDefineDateFormat}}
+This command allows you to define your own date format.
+It does not change how \cs{cuDate} formats its output (for that, use \cs{cuUseDateFormat}).
+Example:
+\end{EN}
+
+\begin{RU}
+\subsection{\cs{cuDefineDateFormat}}
+Команда определяет формат даты. Она никак не влияет на то, как \cs{cuDate} форматирует свой вывод (для этого используется \cs{cuUseDateFormat}).
+Пример:
+\end{RU}
+
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}{l}
+\verb+\cuDefineDateFormat{long}{%+\\
+\verb+ \cuDayName{\cuDOW},+\\
+\verb+ \cuNum{\cuDAY}+_гѡ\verb+~%+\\
+\verb+ \cuMonthName{\cuMONTH},~%+\\
+\verb+ +лѣ́та ѿ сотворе́нїѧ мі́ра\verb+~%+\\
+\verb+ \cuNum{\cuYEARAM}%+\\
+\verb+}+\\
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+%
+\begin{EN}
+defines a format with name \texttt{long}. If we use this format to print the same date as before, we will get:
+\textchurchslavonic{\cuUseDateFormat{long}\cuDate{2016-04-22}}.
+\end{EN}
+%
+\begin{RU}
+определяет новый формат с именем \texttt{long}. Если мы напечатаем дату этим форматом, то получим:
+\textchurchslavonic{\cuUseDateFormat{long}\cuDate{2016-04-22}}.
+\end{RU}
+
+\begin{EN}
+The following symbolic names can be used when formatting the date:
+\begin{itemize}
+\item \cs{cuYEAR} --- the year part of a date (a number, like \texttt{2016})
+\item \cs{cuYEARAM}\footnotemark[1] --- the year Anno Mundi, that is, since the creation of the world accoding to the Byzantine reckoning (aka ``the Byzantine era''; a number, like \texttt{7525})
+\item \cs{cuMONTH} --- the month part of a date (a number from 1 to 12, with January set to 1)
+\item \cs{cuDAY} --- the day of the month
+\item \cs{cuDOW}\footnotemark[1] --- the day of the week (number from 0 to 6, where 0 means ``Sunday'')
+\footnotetext[1]{If your format uses this value, make sure that you format the date with the correct macro:
+ you must use \cs{cuDate} for dates on the Gregorian calendar and
+ \cs{cuDateJulian} for dates on the Julian calendar.}
+\footnotetext[2]{See \url{https://en.wikipedia.org/wiki/Indiction}.}
+\item \cs{cuINDICTION} --- the indiction\footnotemark[2] (a number from 1 to 15)
+\end{itemize}
+
+\end{EN}
+
+\begin{RU}
+При определении формата можно пользоваться следующими символическими именами:
+\begin{itemize}
+\item \cs{cuYEAR} --- год (число, например \texttt{2016})
+\item \cs{cuYEARAM}\footnotemark[1] --- год от сотворения мира по византийскому летоисчеслению (число, например \texttt{7525}).
+\item \cs{cuMONTH} --- месяц (число от 1 до 12, где 1 означает ``январь'')
+\item \cs{cuDAY} --- день месяца
+\item \cs{cuDOW}\footnotemark[1] --- день недели (число от 0 to 6, где 0 означает ``воскресенье'')
+\item \cs{cuINDICTION} --- индикт\footnotemark[2] (число от 1 до 15)
+\footnotetext[1]{Если ваш формат
+ пользуется этим значением, вы должны форматировать дату правильной макрокомандой: \cs{cuDate}
+ для дат по григорианскому календарю и \cs{cuDateJulian} для дат по юлианскому календарю.}
+\footnotetext[2]{См.~\url{https://ru.wikipedia.org/wiki/\%D0\%98\%D0\%BD\%D0\%B4\%D0\%B8\%D0\%BA\%D1\%82}}
+\end{itemize}
+\end{RU}
+
+\begin{EN}
+\subsection{\cs{cuUseDateFormat}}
+This command sets the date format to be used by the subsequent \cs{cuDate} and \cs{cuDateJulian}.
+
+\subsection{\cs{cuMonthName}}
+This command expands a numeric argument (month number) into textual representation. It is typically used when defining a date format.
+For example, a date format named \texttt{default} is defined as:
+\end{EN}
+
+\begin{RU}
+\subsection{\cs{cuUseDateFormat}}
+Макро устанавливает имя текущего формата даты. Этот формат будет использоваться при последующих вызовах макрокоманд
+\cs{cuDate} и \cs{cuDateJulian}.
+
+\subsection{\cs{cuMonthName}}
+Команда раскрывает числовой аргумент в текстовое представление месяца. Команда обычно используется при задании формата
+даты. Например, формат с именем \texttt{default} определен так:
+\end{RU}
+%
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}{l}
+\verb+\cuDefineDateFormat{default}{%+\\
+\verb+ \cuNum{\cuDAY}~\cuMonthName{\cuMONTH},%+\\
+\verb+ ~+лѣ́та\verb+~\cuNum{\cuYEAR}%+\\
+\verb+}%+\\
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+\begin{EN}
+\subsection{\cs{cuDayName}}
+Expands a numeric argument into a textual representation of the day of the week in the nominative case.
+
+\subsection{\cs{cuDayNameAccusative}}
+Expands a numeric argument into a textual representation of the day of the week in the accusative case.
+
+\subsection{\cs{cuToday}}
+This macro expands to a triplet \texttt{YYYY-MM-DD}. The date is generated according to the Gregorian calendar.
+
+\subsection{\cs{cuTodayJulian}}
+This macro expands to a triplet \texttt{YYYY-MM-DD}. The date is generated according to the Julian calendar.
+
+It is a shortcut for \verb+\cuAsJulian{\cuToday}+.
+
+\subsection{\cs{cuAsJulian}}
+Converts a date on the Gregorian calendar to a date on the Julian calendar. Input and output use numeric triplet format \texttt{YYYY-MM-DD}.
+
+Useful when the same date needs to be formatted both according to the Gregorian and Julian calendars.
+
+\subsection{\cs{cuAsGegorian}}
+Converts a date according to the Julian calendar to a date according to the Gregorian calendar. Input and output use numeric triplet format \texttt{YYYY-MM-DD}.
+
+\end{EN}
+
+\begin{RU}
+\subsection{\cs{cuDayName}}
+Команда раскрывает числовой аргумент в текстовое представление дня недели в именительном падеже.
+
+\subsection{\cs{cuDayNameAccusative}}
+Команда раскрывает числовой аргумент в текстовое представление дня недели в винительном падеже.
+
+\subsection{\cs{cuToday}}
+Эта макрокоманда раскрывается в текущую дату в виде триплета \texttt{YYYY-MM-DD}. Дата выводится по григорианскиму календарю (<<новому стилю>>).
+
+\subsection{\cs{cuTodayJulian}}
+Эта макрокоманда раскрывается в текущую дату в виде триплета \texttt{YYYY-MM-DD}. Дата выводится по юлианскиму календарю (<<старому стилю>>).
+
+Команда просто раскрывается в: \verb+\cuAsJulian{\cuToday}+.
+
+\subsection{\cs{cuAsJulian}}
+Преобразует дату по григорианскому календарю в дату по юлианскому календарю.
+Дата задается и выводится как числовой триплет \texttt{YYYY-MM-DD}.
+
+Команда полезна, когда одну и ту же дату надо написать и по григорианскому, и по юлианскому календарю.
+
+\subsection{\cs{cuAsGregorian}}
+Преобразует дату по юлианскому календарю в дату по григорианскому календарю. Дата задается и выводится как числовой триплет \texttt{YYYY-MM-DD}.
+
+\end{RU}
+
+\begin{EN}
+\section{Kinovar}
+Printed and hand-written Church Slavonic texts often use color to highlight sectional
+and paragraph structure and to indicate liturgical rubrics, section names, comments,
+and marginal notes. The first letter of each paragraph is also often colored red.
+
+\subsection{\cs{cuKinovar}}
+Takes a single argument and prints it using red color.
+For example, explicitly specifying its argument one gets the expected result:
+
+\end{EN}
+
+\begin{RU}
+\section{Киноварь}
+Печатные и рукописные книги на церковнославянском языке часто пользуются
+красным цветом (<<киноварью>>) для выделения структурных элементов текста.
+Обычно богослужебные указания (<<рубрики>>), заголовки, замечания и пометы
+на полях печатаются красным цветом. Кроме того, первая буква каждого параграфа тоже
+часто выделяется красным цветом.
+
+\subsection{\cs{cuKinovar}}
+Команда печатает свой аргумент красным цветом. Например, если мы явно зададим текст аргумента, то получим ожидаемый результат:
+\end{RU}
+
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}[]{ | l | l | }
+\hline
+\verb+\cuKinovar{+ли́къ:\verb+}+ гдⷭ҇и поми́лꙋй. & \cuKinovar{ли́къ:} гдⷭ҇и поми́лꙋй. \\
+\hline
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+\begin{EN}
+If one uses the \TeX\ mechanism of implicit argument detection,
+then the first character of the text after this command will be printed in red.
+However, a non-trivial feature of this command is that it will also ``collect'' all
+of the diacritical marks that belong to this first character,
+and thus all accents will also be colored in red!
+Use this command in the indirect parameter mode to print in red the first letter
+of each paragraph.\footnote{You can also experiment
+with the \TeX\ command \cs{everypar} to automate this, but the success or failure of this technique critically depends on the
+\LaTeX\ class used and packages loaded. We found it very fragile and thus the \pkg{churchslavonic} package does not offer
+any automation for this task. It may be easier and more robust to use the Find/Replace functionality embedded in any non-trivial text
+editor to just automatically place a \cs{cuKinovar} command before every paragraph of the source text.}
+\end{EN}
+
+\begin{RU}
+Если же используется механизм \TeX{} неявного задания аргумента, то команда будет применена к первой букве последующего текста.
+При этом команда ``соберет'' все необходимые выносные символы, так что все надстрочные знаки первой буквы будут также корректно раскрашены!
+Поэтому очень удобно использовать эту команду с неявным заданием аргумента для раскраски первой буквы параграфа.\footnote{Вы также
+можете поэкспериментировать со встроенной командой \TeX\ \cs{everypar} с целью полностью автоматизировать раскраску первой буквы
+каждого параграфа. Однако успех сильно зависит от того, какой класс системы \LaTeX\ используется и от того, какие пакеты подгружаются.
+Мы не нашли надежного способа заставить \cs{everypar} работать, и поэтому пакет \pkg{churchslavonic} не предлагает никаких
+макрокоманд для дальнейшей автоматизации этого процесса. На практике, часто проще и надежнее воспользоваться функцией
+текстового редактора Найти/Заменить для вставки макрокоманды \cs{cuKinovar} перед каждым параграфом.}
+\end{RU}
+
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}[]{ | l | l | }
+\hline
+\verb+\cuKinovar+ Пои́мъ гдⷭ҇ви пѣ́снь но́вꙋю &
+\cuKinovar Пои́мъ гдⷭ҇ви пѣ́снь но́вꙋю \\
+\verb+\cuKinovar+ Ꙗ҆́кѡ тꙋ́ча на тро́скотъ & \cuKinovar Ꙗ҆́кѡ тꙋ́ча на тро́скотъ \\
+\hline
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+\begin{EN}
+
+\subsection{\cs{cuKinovarColor}}
+Switches the current color to red. One would typically use this command
+inside a group that limits the scope of red text, unless
+you want all subsequent text to be colored red.
+\end{EN}
+
+\begin{RU}
+
+\subsection{\cs{cuKinovarColor}}
+Команда переключает текущий цвет на красный. Должна использоваться
+внутри группы, которая ограничит ее действие (если вы не хотите
+чтобы весь последующий текст был напечатан красным цветом).
+\end{RU}
+
+\begin{EN}
+\section{Miscellaneous}
+\subsection{\cs{cuMarginMark}, \cs{cuMarginMarkSkip}, \& \cs{cuMarginMarkText}}
+The command \cs{cuMarginMark} is used to place short text in the margin
+at the same level as the line where the macro is placed.
+Example:
+\end{EN}
+%
+\begin{RU}
+\section{Разное}
+\subsection{\cs{cuMarginMark}, \cs{cuMarginMarkSkip} и \cs{cuMarginMarkText}}
+Команда \cs{cuMarginMark} используется для печати значков на полях,
+напротив строки, где вызвана эта команда.
+Например:
+\end{RU}
+%
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}{l}
+ \verb+\cuMarginMark{+в҃\verb+}\cuKinovar+ Бл҃гословѝ дꙋшѐ моѧ̀ гдⷭ҇а и҆ не забыва́й\\
+ всѣ́хъ воздаѧ́нїй є҆гѡ̀. \verb+\cuMarginMark{+а҃\verb+}\cuKinovar+ Ѡ҆чища́ющаго \\
+ всѧ̑ беззакѡ́нїѧ твоѧ̑, и҆сцѣлѧ́ющаго всѧ̑ недꙋ́ги твоѧ̑: \\
+ \verb+\cuMarginMark{+в҃\verb+}\cuKinovar+ И҆збавлѧ́ющаго ѿ и҆стлѣ́нїѧ живо́тъ тво́й,\\
+ вѣнча́ющаго тѧ̀ млⷭ҇тїю и҆ щедро́тами: \verb+\cuMarginMark{+а҃\verb+}\cuKinovar+\\
+ И҆сполнѧ́ющаго во бл҃ги́хъ жела́нїе твоѐ, ѡ҆бнови́тсѧ ꙗ҆́кѡ ѻ҆́рлѧ \\
+ ю҆́ность твоѧ̀.
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+\begin{EN}
+\noindent
+Will result in:
+\end{EN}
+%
+\begin{RU}
+\noindent
+Получим такой результат:
+\end{RU}
+
+\begin{center}
+\begin{churchslavonic}
+\let\hMn=\cuMarginMark
+\let\hKv=\cuKinovar
+\parbox{0.75\textwidth}{%
+ \textwidth=0.75\textwidth
+ \hMn{в҃}\hKv Бл҃гословѝ дꙋшѐ моѧ̀ гдⷭ҇а и҆ не забыва́й всѣ́хъ воздаѧ́нїй є҆гѡ̀.
+ \hMn{а҃}\hKv Ѡ҆чища́ющаго всѧ̑ беззакѡ́нїѧ твоѧ̑, и҆сцѣлѧ́ющаго всѧ̑ недꙋ́ги твоѧ̑:
+ \hMn{в҃}\hKv И҆збавлѧ́ющаго ѿ и҆стлѣ́нїѧ живо́тъ тво́й, вѣнча́ющаго тѧ̀ млⷭ҇тїю и҆ щедро́тами:
+ \hMn{а҃}\hKv И҆сполнѧ́ющаго во бл҃ги́хъ жела́нїе твоѐ, ѡ҆бнови́тсѧ ꙗ҆́кѡ ѻ҆́рлѧ ю҆́ность твоѧ̀.
+}
+\end{churchslavonic}
+\end{center}
+
+\begin{EN}
+The marginal mark is placed on the right margin for odd pages
+and on the left margin for even pages (e.g.~the mark is placed on the
+``outer'' margin, not the spine margin), which is usualy the desired behavior.
+
+The distance between the mark and the text is controlled by the value
+of \cs{cuMarginMarkSkip}. The default is:
+\end{EN}
+%
+\begin{RU}
+Помета помещается на ``внешнее'' поле, то есть справа от текста для нечетных страниц и слева от текста для четных.
+
+Расстояние между пометой и текстом задается через значение \cs{cuMarginMarkSkip}. По умолчанию это:
+\end{RU}
+%
+\begin{verbatim}
+\def\cuMarginMarkSkip{0.6em}
+\end{verbatim}
+
+\begin{EN}
+To globally customize the font and color of the margin mark use \cs{cuMarginMarkText}.
+For example, to make margin marks appear in red color, redefine \cs{cuMarginMarkText} in the preamble of your
+document like this:
+\end{EN}
+%
+\begin{RU}
+Шрифт и цвет пометы можно изменить, переопределив команду \cs{cuMarginMarkText}.
+Например, если Вы хотите чтобы все пометы печатались красным цветом, то достаточно поместить
+в преамбулу вашего документа следующее определение:
+\end{RU}
+\begin{verbatim}
+\def\cuMarginMarkText#1{\cuKinovar{#1}}
+\end{verbatim}
+
+\begin{EN}
+If you need to change the font/size/color just for a single mark, you can do it directly with \cs{cuMarginMark}:
+\end{EN}
+
+\begin{RU}
+Если надо поменять размер, цвет, или шрифт для какой-то одной пометы, то проще всего это сделать при
+вызове \cs{cuMarginMark}:
+\end{RU}
+
+\begin{verbatim}
+\cuMarginMark{{\tiny *}}
+\end{verbatim}
+
+\begin{EN}
+\subsection{Dropcaps}
+The mechanism that the \cs{cuKinovar} macro is using to collect all accents
+(when the argument is specified implicitly) can be useful for
+many other purposes. One example is to typeset a dropletter at the beginning of a chapter
+(this is often used in Church Slavonic texts). For this purpose, the standard \LaTeX\ package
+\pkg{lettrine} works just fine. The only nuisance is that one has to be careful to
+pass to \cs{lettrine} not just the first letter, but also any diacritical marks that
+attach to this letter. Naturally, we want to reuse the
+clever mechanism that \cs{cuKinovar} uses, and automatically collect the diacritical marks!
+
+Here is an example of how to accomplish this:
+\end{EN}
+
+\begin{RU}
+\subsection{Буквицы}
+Механизм, используемый командой \cs{cuKinovar} для сбора выносных символов (при неявном задании аргумента), может оказаться полезен
+в некоторых других случаях. Один из примеров --- это ``буквицы'' в начале разделов. Для набора буквицы отлично работает стандартный
+пакет \pkg{lettrine}. Единственное неудобство --- это необходимость задавать явно первую букву вместе со всеми ее выносными символами.
+Естественно желание упростить и автоматизировать эту работу задействовав тот же механизм, что и в \cs{cuKinovar}.
+
+Вот как можно добиться этого:
+\end{RU}
+
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}{l}
+\verb+\def\cu@lettrine{\lettrine[lines=3,findent=0pt,nindent=0pt]}+\\
+\verb+\def\cuLettrine{\cu@tokenizeletter\cu@lettrine}+\\
+\verb+\renewcommand{\LettrineFontHook}{\cuKinovarColor}+\\
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+%
+\begin{EN}
+Once this definition of \verb+\cuLettrine+ is created (somewhere in the preamble, between the declarations \cs{makeatletter} and \cs{makeatother}),
+you can create drop capitals like this:
+\end{EN}
+%
+\begin{RU}
+Поместите это определение команды \verb+\cuLettrine+ в преамбулу вашего документа (и не забудьте окружить его командами \cs{makeatletter} и \cs{makeatother}).
+После этого можно набирать буквицы так:
+\end{RU}
+%
+\begin{center}
+\begin{churchslavonic}
+\begin{tabular}{l}
+\verb+\cuLettrine+ И҆́же дх҃а си́ла въ не́мощи соверша́етсѧ\ldots\\
+\end{tabular}
+\end{churchslavonic}
+\end{center}
+
+\begin{center}
+\begin{churchslavonic}
+
+\parbox{0.75\textwidth}{%
+\textwidth=0.75\textwidth
+
+\cuLettrine
+И҆́же дх҃а си́ла въ не́мощи соверша́етсѧ, ꙗ҆́коже пи́сано є҆́сть, и҆ вѣ́рꙋемъ: въ не́мощи же не тѣлесѐ то́чїю, но ᲂу҆́бѡ и҆ сло́ва,
+и҆ премꙋ́дрости на ѧ҆зы́цѣ лежа́ща. И҆ сѐ ꙗ҆́вѣ ѿ мно́гихъ ᲂу҆́бѡ и҆ны́хъ, па́че же ѿ и҆́же ѡ҆ вели́комъ бг҃осло́вѣ, и҆ бра́тѣ хрⷭ҇то́вѣ,
+благода́тїю зри́мѣмъ.
+}%
+\end{churchslavonic}
+\end{center}
+
+\begin{thebibliography}{9}
+
+\bibitem{UN41}
+ Aleksandr Andreev, Yuri Shardt, and Nikita Simmons.
+ \emph{Church Slavonic Typography in Unicode},
+ Uncode Technical Note~41. 2015.
+ \url{http://www.unicode.org/notes/tn41/}
+
+\end{thebibliography}
+
+\end{document}
diff --git a/language/churchslavonic/cu-calendar.sty b/language/churchslavonic/cu-calendar.sty
new file mode 100644
index 0000000000..1c2c685a64
--- /dev/null
+++ b/language/churchslavonic/cu-calendar.sty
@@ -0,0 +1,182 @@
+% Copyright 2016 Slavonic Computing Initialive
+% http://sci.ponomar.net
+%
+\ProvidesPackage{cu-calendar}[2016/03/30 v1.0 CU Calendars]
+
+\RequirePackage{intcalc}
+\RequirePackage{cu-num}
+
+%
+% Tools
+%
+\def\cu@jdn#1-#2-#3-#4{%
+ \expandafter\cu@@jdn
+ \expandafter{\the\numexpr \intcalcDiv{14 - #2}{12} \relax}{#1}{#2}{#3}{#4}%
+}%
+\def\cu@@jdn#1#2#3#4#5{%
+ \expandafter\cu@@@jdn
+ \expandafter{\the\numexpr #2 + 4800 - #1\relax}{#1}{#2}{#3}{#4}{#5}%
+}%
+\def\cu@@@jdn#1#2#3#4#5#6{% y a year month day
+ \expandafter\cu@@@@jdn
+ \expandafter{\the\numexpr #4 - 3 + 12 * (#2)\relax}{#1}{#2}{#3}{#4}{#5}{#6}%
+}%
+\def\cu@@@@jdn#1#2#3#4#5#6#7{% m y a year month day
+ \expandafter #7%
+ \expandafter{\the\numexpr #6 +
+ \intcalcDiv{153 * (#1) + 2}{5} + (365 * (#2)) + \intcalcDiv{#2}{4} - 32083\relax}{#2}%
+}%
+\def\greg@#1#2{% jdn_julian y
+ \expandafter\greg@@
+ \expandafter{\the\numexpr #1 - \intcalcDiv{#2}{100}\relax}{#2}%
+}%
+\def\greg@@#1#2{% jdn_julian y
+ \the\numexpr #1 + \intcalcDiv{#2}{400} + 32083 - 32045\relax%
+}%
+%
+\def\cu@jdnFromDateJulian#1{%
+ \cu@jdn #1-\@firstoftwo
+}%
+\def\cu@jdnFromDateGregorian#1{%
+ \cu@jdn #1-\greg@
+}%
+%
+\def\cu@calendar#1{%
+ \expandafter\cu@@calendar
+ \expandafter{\the\numexpr (#1 + 1401) * 4 + 3\relax}%
+}%
+\def\cu@@calendar#1{% e
+ \expandafter\cu@@@calendar
+ \expandafter{\the\numexpr 2 +
+ \intcalcMul{5}{\intcalcDiv{\intcalcMod{#1}{1461}}{4}} \relax}{#1}%
+}%
+\def\cu@@@calendar#1#2{% h e
+ \expandafter\cu@@@@calendar
+ \expandafter{\the\numexpr 1 + \intcalcDiv{\intcalcMod{#1}{153}}{5}\relax}{#1}{#2}%
+}%
+\def\cu@@@@calendar#1#2#3{% day h e
+ \expandafter\cu@@@@@calendar
+ \expandafter{\the\numexpr 1 +
+ \intcalcMod{\intcalcAdd{\intcalcDiv{#2}{153}}{2}}{12}\relax}{#1}{#2}{#3}%
+}%
+\def\cu@@@@@calendar#1#2#3#4{% month day h e
+ \the\numexpr
+ \intcalcDiv{#4}{1461} - 4716 + \intcalcDiv{14-#1}{12}\relax -#1-#2%
+}%
+\def\cu@calendarJulian#1{\cu@calendar{#1}}%
+\def\cu@calendarGregorian#1{%
+ \expandafter\cu@calendar\expandafter{%
+ \the\numexpr #1 +
+ \intcalcDiv{\intcalcMul{\intcalcDiv{274277 + 4 * (#1)}{146097}}{3}}{4} - 38
+ \relax
+}}%
+%
+\def\cu@julianToGregorian#1{%
+ \cu@calendarGregorian{\cu@jdnFromDateJulian{#1}}%
+}%
+\def\cu@gregorianToJulian#1{%
+ \cu@calendarJulian{\cu@jdnFromDateGregorian{#1}}%
+}%
+\let\cu@julianFromGregorian\cu@gregorianToJulian
+\let\cu@gregorianFromJulian\cu@julianToGregorian
+%
+% User API
+%
+\let\cuAsJulian\cu@julianFromGregorian
+\let\cuAsGregorian\cu@gregorianFromJulian
+%
+\def\cuDateJulian#1{%
+ \expandafter\cu@formatDate\number\cu@julianFromGregorian{#1}\relax
+}%
+\def\cuTodayJulian{%
+ \cu@julianFromGregorian{\year -\month -\day}%
+}%
+\def\cuToday{%
+ \year -\month -\day
+}%
+\def\cuDate#1{%
+ \expandafter\cu@formatDate\number #1\relax
+}%
+%
+\def\cuMonthName#1{%
+ \ifcase#1\or%
+ і҆аннꙋа́рїа\or
+ феврꙋа́рїа\or
+ ма́рта\or
+ а҆прі́ллїа\or
+ ма́їа\or
+ і҆ꙋ́нїа\or
+ і҆ꙋ́лїа\or
+ а҆́ѵгꙋста\or
+ септе́мврїа\or
+ ѻ҆ктѡ́врїа\or
+ ное́мврїа\or
+ деке́мврїа\fi
+}%
+%
+\def\cuDayName#1{%
+ \ifcase#1 недѣ́лѧ\or%
+ понедѣ́льникъ\or
+ вто́рникъ\or
+ среда̀\or
+ четверто́къ\or
+ пѧто́къ\or
+ сꙋббѡ́та\fi
+}%
+%
+\def\cuDayNameAccusative#1{%
+ \ifcase#1 недѣ́лю\or%
+ понедѣ́льникъ\or
+ вто́рникъ\or
+ сре́дꙋ\or
+ четверто́къ\or
+ пѧто́къ\or
+ сꙋббѡ́тꙋ\fi
+}%
+%
+\def\cuDefineDateFormat#1#2{%
+ \expandafter\def\csname cs@dateformat@#1\endcsname{#2}%
+}%
+\def\cuUseDateFormat#1{%
+ \expandafter\let\expandafter\cu@current@dateformat\csname cs@dateformat@#1\endcsname
+}%
+\def\cu@@formatDate#1-#2-#3\relax{%
+ \edef\cu@JDN{\cu@jdnFromDateGregorian{#1-#2-#3}}%
+ \edef\cu@JDN@March@First{\cu@jdnFromDateJulian{#1-3-1}}%
+ \edef\cuYEAR{\number #1}%
+ \edef\cuYEARAM{\the\numexpr #1 + 5508\ifnum\cu@JDN<\cu@JDN@March@First\else + 1\fi}%
+ \edef\cuMONTH{\number #2}%
+ \edef\cuDAY{\number #3}%
+ \edef\cuDOW{\intcalcMod{1+\cu@JDN}{7}}%
+ \edef\cuINDICTION{\intcalcAdd{15}{\intcalcMod{#1 - 312}{-15}}}%
+ \edef\cuDISPLAYDATE{\cu@current@dateformat}%
+}%
+\def\cu@@formatDateJulian#1-#2-#3\relax{%
+ \edef\cu@JDN{\cu@jdnFromDateJulian{#1-#2-#3}}%
+ \edef\cu@JDN@March@First{\cu@jdnFromDateJulian{#1-3-1}}%
+ \edef\cuYEAR{\number #1}%
+ \edef\cuYEARAM{\the\numexpr #1 + 5508\ifnum\cu@JDN<\cu@JDN@March@First\else + 1\fi}%
+ \edef\cuMONTH{\number #2}%
+ \edef\cuDAY{\number #3}%
+ \edef\cuDOW{\intcalcMod{1+\cu@JDN}{7}}%
+ \edef\cuINDICTION{\intcalcAdd{15}{\intcalcMod{#1 - 312}{-15}}}%
+ \edef\cuDISPLAYDATE{\cu@current@dateformat}%
+}%
+\protected\def\cu@formatDate#1-#2-#3\relax{%
+ \bgroup
+ \cu@@formatDate#1-#2-#3\relax
+ \cuDISPLAYDATE
+ \egroup
+}%
+%
+\protected\def\cu@formatDateJulian#1-#2-#3\relax{%
+ \bgroup
+ \cu@@formatDateJulian#1-#2-#3\relax
+ \cuDISPLAYDATE
+ \egroup
+}%
+\cuDefineDateFormat{default}{%
+ \cuNum{\cuDAY}~\cuMonthName{\cuMONTH},~лѣ́та~\cuNum{\cuYEAR}%
+}%
+\cuUseDateFormat{default}%
+%
diff --git a/language/churchslavonic/cu-kinovar.sty b/language/churchslavonic/cu-kinovar.sty
new file mode 100644
index 0000000000..445067e4fe
--- /dev/null
+++ b/language/churchslavonic/cu-kinovar.sty
@@ -0,0 +1,41 @@
+\ProvidesPackage{cu-kinovar}[2016/03/31 v1.0 CU Kinovar]
+
+\RequirePackage{cu-util}
+\RequirePackage{etoolbox}
+\RequirePackage{xcolor}
+
+%% 'color' option (default)
+\def\cu@kinovar{\relax}
+\def\cu@kinovar@color{\relax}
+
+\DeclareOption{color}{
+ \renewcommand{\cu@kinovar}[1]{\textcolor{kinovar}{#1}}
+ \renewcommand{\cu@kinovar@color}{\color{kinovar}}
+}
+\DeclareOption{gray}{
+ \renewcommand{\cu@kinovar}[1]{\textcolor{kinovar-gray}{#1}}
+ \renewcommand{\cu@kinovar@color}{\color{kinovar-gray}}
+}
+\DeclareOption{grey}{
+ \renewcommand{\cu@kinovar}[1]{\textcolor{kinovar-gray}{#1}}
+ \renewcommand{\cu@kinovar@color}{\color{kinovar-gray}}
+}
+\DeclareOption{bw}{
+ \renewcommand{\cu@kinovar}[1]{#1}
+ \renewcommand{\cu@kinovar@color}{\relax}
+}
+
+\ExecuteOptions{color}
+\ProcessOptions\relax
+
+% define standard colors
+\definecolor{kinovar}{rgb}{0.80,0.03,0.01}
+\definecolor{kinovar-gray}{rgb}{0.45,0.45,0.45}
+
+% cuKinovar command colors just one letter with all accents if any
+\newrobustcmd{\cuKinovar}{\cu@tokenizeletter{\cu@kinovar}}
+
+% cuKinovarColorr switches foregrouond color to Kinovar
+\newrobustcmd{\cuKinovarColor}{\cu@kinovar@color}
+
+\endinput
diff --git a/language/churchslavonic/cu-num.sty b/language/churchslavonic/cu-num.sty
new file mode 100644
index 0000000000..1a84190ead
--- /dev/null
+++ b/language/churchslavonic/cu-num.sty
@@ -0,0 +1,341 @@
+% Copyright 2016 Slavonic Computing Initialive
+% http://sci.ponomar.net
+%
+\ProvidesPackage{cu-num}[2016/03/03 v1.0 CU Numerics]
+
+\@ifundefined{detokenize}{%
+ \PackageError{cu-num}%
+ {You must upgrade your TeX distribution to be able to use this package}%
+ {This package depends on eTeX-based engine}%
+}{}
+
+%
+% Tools
+%
+\def\cu@ifempty#1{%
+ \if\relax\detokenize{#1}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}%
+%
+\def\@firstoffour\cu@repeat #1\stop@ #2#3#4#5{#2}%
+\def\@firstofthree\cu@repeat@i #1\stop@ #2#3#4{#2}%
+\def\cu@switch #1{%
+ \if\relax\detokenize{#1}\relax
+ \expandafter\@firstoffour
+ \fi
+ \cu@repeat #1\stop@
+}%
+\def\cu@repeat #1#2\stop@ #3{%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@firstofthree
+ \fi
+ \cu@repeat@i #2\stop@
+}%
+\def\cu@repeat@i #1#2\stop@ #3{%
+ \if\relax\detokenize{#2}\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}%
+%
+% Slavonic numbering system. Internals.
+%
+\def\cu@format@small@number#1#2#3{%
+ \ifcase#1 \or
+ \expandafter р\or
+ \expandafter с\or
+ \expandafter т\or
+ \expandafter у\or
+ \expandafter ф\or
+ \expandafter х\or
+ \expandafter ѱ\or
+ \expandafter ѿ\or
+ \expandafter ц\else
+ \errmessage{cu-num: Internal error}%
+ \fi
+ \if 1#2%
+ \ifcase#3 \or
+ \expandafter а\or
+ \expandafter в\or
+ \expandafter г\or
+ \expandafter д\or
+ \expandafter є\or
+ \expandafter ѕ\or
+ \expandafter з\or
+ \expandafter и\or
+ \expandafter ѳ\else
+ \errmessage{cu-num: Internal error}%
+ \fi
+ і%
+ \else
+ \ifcase#2 \or
+ \expandafter і\or
+ \expandafter к\or
+ \expandafter л\or
+ \expandafter м\or
+ \expandafter н\or
+ \expandafter ѯ\or
+ \expandafter ѻ\or
+ \expandafter п\or
+ \expandafter ч\else
+ \errmessage{cu-num: Internal error}%
+ \fi
+ \ifcase#3 \or
+ \expandafter а\or
+ \expandafter в\or
+ \expandafter г\or
+ \expandafter д\or
+ \expandafter є\or
+ \expandafter ѕ\or
+ \expandafter з\or
+ \expandafter и\or
+ \expandafter ѳ\else
+ \errmessage{cu-num: Internal error}%
+ \fi
+ \fi
+}%
+%
+%
+\protected\def\cu@titlo{\char"0483}%
+\def\cu@thousand{҂}%
+\protected\def\cu@spacer{\,}%
+%
+\protected\def\stop@{}%
+\protected\def\divider@{DIVIDER}%
+%
+\def\cu@format#1{%
+ \ifnum#1<0%
+ \errmessage{cu-num: negative numbers not supported}%
+ \else\ifnum#1=0%
+ 0\cu@titlo
+ \else\ifnum#1<10%
+ {}%
+ {}%
+ \cu@format@xxx 00#1\stop@
+ \else\ifnum#1<100%
+ {}%
+ {}%
+ \cu@format@xxx 0#1\stop@
+ \else\ifnum#1<1000%
+ {}%
+ {}%
+ \cu@format@xxx #1\stop@
+ \else\ifnum#1<10000%
+ {}%
+ \cu@format@xxxxxx 00#1\stop@
+ \else\ifnum#1<100000%
+ {}%
+ \cu@format@xxxxxx 0#1\stop@
+ \else\ifnum#1<1000000%
+ {}%
+ \cu@format@xxxxxx #1\stop@
+ \else\ifnum#1<10000000%
+ \cu@format@xxxxxxxxx 00#1\stop@
+ \else\ifnum#1<100000000%
+ \cu@format@xxxxxxxxx 0#1\stop@
+ \else\ifnum#1<1000000000%
+ \cu@format@xxxxxxxxx #1\stop@
+ \else
+ \errmessage{cu-num: number too big "#1"}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}%
+%
+\def\cu@format@xxx#1#2#3\stop@{%
+ {%
+ \cu@format@small@number#1#2#3%
+ }%
+}%
+%
+\def\cu@format@xxxxxx#1#2#3#4#5#6\stop@{%
+ {\cu@format@small@number#1#2#3}%
+ {\cu@format@small@number#4#5#6}%
+}%
+%
+\def\cu@format@xxxxxxxxx#1#2#3#4#5#6#7#8#9\stop@{%
+ {\cu@format@small@number#1#2#3}%
+ \cu@format@xxxxxx#4#5#6#7#8#9\stop@
+}%
+%
+\def\cu@place@titlo #1{%
+ \cu@switch{#1}{%
+ {}%
+ }{%
+ {\cu@place@titlo@i #1\stop@}%
+ }{%
+ {\cu@place@titlo@ii #1\stop@}%
+ }{%
+ {\cu@place@titlo@iii #1\stop@}%
+ }%
+}%
+\def\cu@place@titlo@iii #1#2#3#4\stop@{%
+ \cu@ifempty{#4}{%
+ #1\cu@place@titlo@ii #2#3\stop@
+ }{%
+ #1\cu@place@titlo@iii #2#3#4\stop@
+ }%
+}%
+\def\cu@place@titlo@ii #1#2\stop@{%
+ \if #1ѿ%
+ #1#2\cu@titlo\else #1\cu@titlo #2\fi
+}%
+\def\cu@place@titlo@i #1\stop@{%
+ \if #10%
+ 0\else #1\cu@titlo \fi
+}%
+%
+\def\cu@merge@historic #1#2#3{%
+ \cu@switch{#2}{%
+ {#1}{#2}{#3}%
+ }{%
+ {#1}{#2#3}{0}%
+ }{%
+ {#1}{#2}{#3}%
+ }{%
+ {#1}{#2}{#3}%
+ }%
+}%
+%
+\def\cu@place@thousands#1#2#3{%
+ \cu@ifempty{#1}{%
+ {}%
+ }{%
+ {\cu@thousand\cu@thousand #1}%
+ }%
+ \cu@ifempty{#2}{%
+ {}%
+ }{%
+ \if#30%
+ {\cu@thousand #2}%
+ \else
+ \cu@ifempty{#3}{%
+ {\cu@interleave #2\stop@}%
+ }{%
+ {\cu@thousand #2}%
+ }%
+ \fi
+ }%
+ \if#30%
+ {}%
+ \else
+ {#3}%
+ \fi
+}%
+%
+\def\cu@interleave#1#2\stop@{%
+ \ifx#1\cu@titlo
+ \cu@ifempty{#2}{#1}{%
+ #1\cu@interleave #2\stop@
+ }%
+ \else
+ \cu@ifempty{#2}{%
+ \cu@thousand #1%
+ }{%
+ \cu@thousand #1\cu@interleave #2\stop@
+ }%
+ \fi
+}%
+%
+\def\cu@place@all@titlo#1#2#3{%
+ \cu@place@titlo{#1}%
+ \cu@place@titlo{#2}%
+ \cu@place@titlo{#3}%
+}%
+\def\cu@place#1{%
+ \if\relax\detokenize{#1}\relax
+ {}%
+ \else
+ \cu@place@i #1\stop@
+ \fi
+}%
+\def\cu@place@i#1#2\stop@{%
+ \if\relax\detokenize{#2}\relax
+ {#1\cu@titlo}%
+ \else
+ \cu@place@ii #1#2\stop@
+ \fi
+}%
+\def\cu@place@ii #1#2#3\stop@{%
+ \if\relax\detokenize{#3}\relax
+ \if#1ѿ{#1#2\cu@titlo}\else
+ {#1\cu@titlo #2}\fi
+ \else
+ \if#2ѿ{#1#2#3\cu@titlo}\else
+ {#1#2\cu@titlo #3}\fi
+ \fi
+}%
+%
+\def\cu@compose#1#2#3{%
+ \cu@ifempty{#1}{%
+ \cu@compose@ii{#2}{#3}%
+ }{%
+ \cu@ifempty{#2}{%
+ \cu@compose@ii{#1}{#3}%
+ }{%
+ \cu@ifempty{#3}{%
+ \cu@compose@ii{#1}{#2}%
+ }{%
+ #1\cu@spacer #2\cu@spacer #3%
+ }%
+ }%
+ }%
+}%
+%
+\def\cu@compose@ii#1#2{%
+ \cu@ifempty{#1}{%
+ \cu@ifempty{#2}{}{#2}%
+ }{%
+ \cu@ifempty{#2}{#1}{#1\cu@spacer #2}%
+ }%
+}%
+%
+\def\cu@fmt@#1{%
+ %\tracingmacros=1%
+ %\tracingonline=1%
+ \edef\@x{\number #1}%
+ \ifnum\@x=0\relax
+ \edef\@x{0\cu@titlo}%
+ \else\ifnum\@x<0%
+ \edef\@x{\number-\@x}%
+ \edef\@x{\noexpand\cu@format{\@x}}%
+ \edef\@x{\@x}%
+ \edef\@x{\noexpand\cu@merge@historic\@x}%
+ \edef\@x{\@x}%
+ \edef\@x{\noexpand\cu@place@all@titlo\@x}%
+ \edef\@x{\@x}%
+ \edef\@x{\noexpand\cu@place@thousands\@x}%
+ \edef\@x{\@x}%
+ \edef\@x{\noexpand\cu@compose\@x}%
+ \edef\@x{\@x}%
+ \edef\@x{-\@x}%
+ \else
+ \edef\@x{\noexpand\cu@format{\@x}}%
+ \edef\@x{\@x}%
+ %\show\@x
+ \edef\@x{\noexpand\cu@merge@historic\@x}%
+ \edef\@x{\@x}%
+ %\show\@x
+ \edef\@x{\noexpand\cu@place@all@titlo\@x}%
+ \edef\@x{\@x}%
+ %\show\@x
+ \edef\@x{\noexpand\cu@place@thousands\@x}%
+ \edef\@x{\@x}%
+ %\show\@x
+ \edef\@x{\noexpand\cu@compose\@x}%
+ \edef\@x{\@x}%
+ %\show\@x
+ \fi\fi
+ %\tracingmacros=0%
+}%
+%
+% User API
+%
+\protected\def\cuNum#1{%
+ \bgroup
+ \cu@fmt@{#1}%
+ \@x
+ \egroup
+}%
diff --git a/language/churchslavonic/cu-util.sty b/language/churchslavonic/cu-util.sty
new file mode 100644
index 0000000000..212b58886b
--- /dev/null
+++ b/language/churchslavonic/cu-util.sty
@@ -0,0 +1,196 @@
+\ProvidesPackage{cu-util}[2016/03/31 v1.0 CU Util]
+
+\RequirePackage{etoolbox}
+%
+% Some ideas taken from:
+% http://tex.stackexchange.com/questions/33197/parsing-a-macro-argument-character-by-character-for-conditional-execution
+%
+\def\cu@declare@accent#1{%
+ \def\cu@@declare@accent##1##2\relax{%
+ \@namedef{cu@accent@\detokenize{##2}}{\relax}%
+ }%
+ \cu@@declare@accent#1\relax
+}%
+%
+\newcommand\cu@tokenizeletter[1]{%
+ \bgroup
+ \def\@accum{}%
+ \def\cu@collectworker{%
+ \cu@ifnextaccent{%
+ \cu@collectworker@one
+ }{%
+ \expandafter \egroup \expandafter #1\expandafter {\@accum}%
+ }%
+ }%
+ \def\cu@collectworker@one##1{%
+ \edef\@accum{\@accum ##1}%
+ \cu@collectworker
+ }%
+ \def\cu@collectworker@two##1##2{%
+ \edef\@accum{\@accum ##1##2}%
+ \cu@collectworker
+ }%
+ \cu@ifnextbgroup{\egroup #1}{%
+ \cu@ifnextdigraph{\cu@collectworker@two}{\cu@collectworker@one}%
+ }%
+}%
+%
+\newrobustcmd\cu@ifnextletter[2]{%
+ \bgroup
+ \def\cu@worker{%
+ \ifcat\noexpand\@let@token a%
+ \expandafter\egroup\expandafter\@firstoftwo
+ \else
+ \expandafter\egroup\expandafter\@secondoftwo
+ \fi
+ {#1}{#2}%
+ }%
+ \futurelet\@let@token\cu@worker
+}
+%
+\newrobustcmd\cu@ifnextaccent[2]{%
+ \bgroup
+ \def\cu@letter@i{%
+ \ifdefequal{\@let@token}{ }{%
+ \egroup #2% false
+ }{%
+ \cu@letter@ii
+ }%
+ }%
+ \def\cu@letter@ii##1{%
+ \ifcsdef{cu@accent@\detokenize{##1}}{%
+ \egroup #1##1% true
+ }{%
+ \egroup #2##1% false
+ }%
+ }%
+ \futurelet\@let@token\cu@letter@i
+}%
+%
+% Detect Oy and oy digraphs
+% kv command colors just one letter with all accents if any
+\def\cu@declare@digraph#1#2\relax{%
+ \@namedef{cu@digraph@start@\detokenize{#1}}{\relax}%
+ \@namedef{cu@digraph@end@\detokenize{#2}}{\relax}%
+}%
+%
+\cu@declare@digraph оу\relax
+\cu@declare@digraph Оу\relax
+\cu@declare@digraph ᲂу\relax
+%
+\newrobustcmd{\cu@ifnextdigraph}[2]{%
+ \bgroup
+ \def\cu@digraph@i{%
+ \ifdefequal{\@let@token}{ }{%
+ \egroup #2% false!
+ }{%
+ \cu@digraph@ii
+ }%
+ }%
+ \def\cu@digraph@ii##1{%
+ \ifcsdef{cu@digraph@start@\detokenize{##1}}{%
+ \edef\@accum{\@accum##1}%
+ \futurelet\@let@token\cu@digraph@iii
+ }{%
+ \egroup #2##1% false!
+ }%
+ }%
+ \def\cu@digraph@iii##1{%
+ \ifcsdef{cu@digraph@end@\detokenize{##1}}{%
+ \expandafter \egroup \expandafter #1\@accum ##1% true!
+ }{%
+ \expandafter \egroup \expandafter #2\@accum ##1% false!
+ }%
+ }%
+ \def\@accum{}%
+ \futurelet\@let@token\cu@digraph@i
+}%
+%
+\newrobustcmd{\cu@ifnextbgroup}[2]{%
+ \bgroup
+ \def\cu@bgroup{%
+ \ifdefequal{\@let@token}{ }{%
+ \egroup #2% false!
+ }{%
+ \egroup\@ifnextchar\bgroup{#1}{#2}%
+ }%
+ }%
+ \futurelet\@let@token\cu@bgroup
+}%
+%
+\def\cu@test@tokenizeletter#1#2{%
+ \bgroup
+ \def\cu@testframe##1##2\@nnil{%
+ \edef\@aa{##1-##2}%
+ }%
+ \cu@tokenizeletter\cu@testframe #1\@nnil
+ \def\@bb{#2}%
+ \ifx\@aa\@bb\else
+ \errmessage{TEST FAILED: #1: "\@aa" expected "\@bb"}%
+ \fi
+ \egroup
+}%
+%
+% List all accents
+%
+%% declare all possible combineres (generated by make_declare_accents)
+\cu@declare@accent{◌̀}
+\cu@declare@accent{◌́}
+\cu@declare@accent{◌̑}
+\cu@declare@accent{◌̈}
+\cu@declare@accent{◌҆}
+\cu@declare@accent{◌̆}
+\cu@declare@accent{◌̾}
+\cu@declare@accent{◌꙽}
+\cu@declare@accent{◌꙼}
+\cu@declare@accent{◌̇}
+\cu@declare@accent{◌̏}
+\cu@declare@accent{◌҃}
+\cu@declare@accent{◌҇}
+\cu@declare@accent{◌ⷠ}
+\cu@declare@accent{◌ⷡ}
+\cu@declare@accent{◌ⷢ}
+\cu@declare@accent{◌ⷣ}
+\cu@declare@accent{◌ⷤ}
+\cu@declare@accent{◌ⷥ}
+\cu@declare@accent{◌ⷦ}
+\cu@declare@accent{◌ⷧ}
+\cu@declare@accent{◌ⷨ}
+\cu@declare@accent{◌ⷩ}
+\cu@declare@accent{◌ⷪ}
+\cu@declare@accent{◌ⷫ}
+\cu@declare@accent{◌ⷬ}
+\cu@declare@accent{◌ⷭ}
+\cu@declare@accent{◌ⷮ}
+\cu@declare@accent{◌ⷯ}
+\cu@declare@accent{◌ⷰ}
+\cu@declare@accent{◌ⷱ}
+\cu@declare@accent{◌ⷲ}
+\cu@declare@accent{◌ⷳ}
+\cu@declare@accent{◌ⷴ}
+\cu@declare@accent{◌ⷵ}
+\cu@declare@accent{◌ⷶ}
+\cu@declare@accent{◌ⷷ}
+\cu@declare@accent{◌ⷸ}
+\cu@declare@accent{◌ⷹ}
+\cu@declare@accent{◌ⷺ}
+\cu@declare@accent{◌ⷻ}
+\cu@declare@accent{◌ⷼ}
+\cu@declare@accent{◌ⷽ}
+\cu@declare@accent{◌ⷾ}
+\cu@declare@accent{◌ⷿ}
+\cu@declare@accent{◌ꙴ}
+\cu@declare@accent{◌ꙵ}
+\cu@declare@accent{◌ꙶ}
+\cu@declare@accent{◌ꙷ}
+\cu@declare@accent{◌ꙸ}
+\cu@declare@accent{◌ꙹ}
+\cu@declare@accent{◌ꙺ}
+\cu@declare@accent{◌ꙻ}
+\cu@declare@accent{◌꙼}
+\cu@declare@accent{◌꙽}
+\cu@declare@accent{◌҆}
+\cu@declare@accent{◌҅}
+%% end of generated block
+
+\endinput
diff --git a/language/churchslavonic/gloss-churchslavonic.ldf b/language/churchslavonic/gloss-churchslavonic.ldf
new file mode 100644
index 0000000000..5479caa9da
--- /dev/null
+++ b/language/churchslavonic/gloss-churchslavonic.ldf
@@ -0,0 +1,245 @@
+\ProvidesFile{gloss-churchslavonic.ldf}[polyglossia: module for Church Slavonic]
+\PolyglossiaSetup{churchslavonic}{
+ 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.
+\define@key{churchslavonic}{spelling}[modern]{%
+ \ifstrequal{#1}{traditional}%
+ {\def\captionschurchslavonic{\captionschurchslavonic@traditional}%
+ \def\datechurchslavonic{\datechurchslavonic@traditional}}%
+ {\def\captionschurchslavonic{\captionschurchslavonic@modern}%
+ \def\datechurchslavonic{\datechurchslavonic@modern}}%
+}
+
+\newif\ifcyrillic@numerals
+\define@key{churchslavonic}{numerals}[latin]{%
+ \ifstrequal{#1}{cyrillic}%
+ {\cyrillic@numeralstrue}
+ {\cyrillic@numeralsfalse}%
+}
+
+\define@boolkey{churchslavonic}[churchslavonic@]{babelshorthands}[false]{}
+
+\setkeys{churchslavonic}{spelling,numerals}
+
+\ifsystem@babelshorthands
+ \setkeys{churchslavonic}{babelshorthands=true}
+\else
+ \setkeys{churchslavonic}{babelshorthands=false}
+\fi
+
+\ifcsundef{initiate@active@char}{%
+ \input{babelsh.def}%
+ \initiate@active@char{"}%
+}{}
+
+\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
+