summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/churchslavonic/churchslavonic.sty
blob: 4b0f5a106a0a2bc77551cdee18020d613d7aa026 (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
% 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