diff options
Diffstat (limited to 'Master/texmf-dist/tex')
4 files changed, 290 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/churchslavonic/churchslavonic.sty b/Master/texmf-dist/tex/latex/churchslavonic/churchslavonic.sty index 4b0f5a106a0..60f8c0e91e1 100644 --- a/Master/texmf-dist/tex/latex/churchslavonic/churchslavonic.sty +++ b/Master/texmf-dist/tex/latex/churchslavonic/churchslavonic.sty @@ -1,24 +1,51 @@ % Copyright 2016 Slavonic Computing Initiative % http://sci.ponomar.net -% -\ProvidesPackage{churchslavonic}[2016/04/19 v0.2 Typesetting in Church Slavonic] +% +\ProvidesPackage{churchslavonic}[v0.2.4 2023.06.22 Typesetting in Church Slavonic] +\DeclareOption{autocolormarks}{ + \PassOptionsToPackage{\CurrentOption}{cu-kruk} +} +\DeclareOption{noautocolormarks}{ + \PassOptionsToPackage{\CurrentOption}{cu-kruk} +} \DeclareOption*{ \PassOptionsToPackage{\CurrentOption}{cu-kinovar} } \ProcessOptions\relax +\RequirePackage{ifluatex} \RequirePackage{cu-num} \RequirePackage{cu-calendar} \RequirePackage{cu-util} \RequirePackage{cu-kinovar} +\RequirePackage{cu-kruk} % underscore is a valid character in Church Slavonic \let\cu@oldunderscore=_ +{% \catcode`\_\active -\protected\def_{\ifmmode\cu@oldunderscore\else\textunderscore\discretionary{}{}{}\fi} +\global\protected\def_{\ifmmode\cu@oldunderscore\else\textunderscore\discretionary{}{}{}\fi}% +}% +\AtBeginDocument{\catcode`\_\active}% + +\ifluatex +\AtBeginDocument{\cu@set@hyphenchar@lualatex} +\else +\AtBeginDocument{\cu@set@hyphenchar@xelatex} +\fi + +\def\cu@set@hyphenchar@lualatex{ + \@ifpackageloaded{polyglossia}{% + \textchurchslavonic{\prehyphenchar=`\_}% + }{% + }% +}% + +\def\cu@set@hyphenchar@xelatex{ +}% -% suppress variable distance between lines +% suppress variable distance between lines \lineskiplimit -1ex % margin marks diff --git a/Master/texmf-dist/tex/latex/churchslavonic/cu-kinovar.sty b/Master/texmf-dist/tex/latex/churchslavonic/cu-kinovar.sty index 445067e4fe9..4a8c5d2a5b1 100644 --- a/Master/texmf-dist/tex/latex/churchslavonic/cu-kinovar.sty +++ b/Master/texmf-dist/tex/latex/churchslavonic/cu-kinovar.sty @@ -1,41 +1,51 @@ -\ProvidesPackage{cu-kinovar}[2016/03/31 v1.0 CU Kinovar] +\ProvidesPackage{cu-kinovar}[2020/10/21 v1.2 CU Kinovar] \RequirePackage{cu-util} \RequirePackage{etoolbox} \RequirePackage{xcolor} +\RequirePackage{ifluatex} +\ifluatex + \RequirePackage{luacolor} +\fi -%% 'color' option (default) -\def\cu@kinovar{\relax} -\def\cu@kinovar@color{\relax} +\newcommand{\cu@kinovar}[1]{\textcolor{kinovar}{#1}} +\newcommand{\cuKinovarColor}{\color{kinovar}} \DeclareOption{color}{ - \renewcommand{\cu@kinovar}[1]{\textcolor{kinovar}{#1}} - \renewcommand{\cu@kinovar@color}{\color{kinovar}} + \colorlet{kinovar}{kinovar-red} } \DeclareOption{gray}{ - \renewcommand{\cu@kinovar}[1]{\textcolor{kinovar-gray}{#1}} - \renewcommand{\cu@kinovar@color}{\color{kinovar-gray}} + \colorlet{kinovar}{kinovar-gray} } \DeclareOption{grey}{ - \renewcommand{\cu@kinovar}[1]{\textcolor{kinovar-gray}{#1}} - \renewcommand{\cu@kinovar@color}{\color{kinovar-gray}} + \colorlet{kinovar}{kinovar-gray} } \DeclareOption{bw}{ - \renewcommand{\cu@kinovar}[1]{#1} - \renewcommand{\cu@kinovar@color}{\relax} + \colorlet{kinovar}{kinovar-black} } -\ExecuteOptions{color} -\ProcessOptions\relax - % define standard colors -\definecolor{kinovar}{rgb}{0.80,0.03,0.01} +\definecolor{kinovar-red}{rgb}{0.80,0.03,0.01} +\colorlet{kinovar-black}{.} \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}} +\ExecuteOptions{color} +\ProcessOptions\relax -% cuKinovarColorr switches foregrouond color to Kinovar -\newrobustcmd{\cuKinovarColor}{\cu@kinovar@color} +% cuKinovar command colors just one letter with all accents if any +\newrobustcmd{\cuKinovar}{\cu@tokenizeletter{\cu@kinovar@kern}} + +\newcommand{\cu@kinovar@kern}[1]{% + \cu@kinovar{#1}% + \cu@ifnextletter{\cu@kinovar@insert@kern{#1}}{}% +}% +\newsavebox\cu@box@zero +\newsavebox\cu@box@one +\newdimen\cu@kerning +\newcommand{\cu@kinovar@insert@kern}[2]{% + \sbox\cu@box@zero{#1#2}\sbox\cu@box@one{\mbox{#1}\mbox{#2}}% + \dimen\cu@kerning=\dimexpr\wd\cu@box@zero-\wd\cu@box@one + \kern\dimen\cu@kerning #2% +}% \endinput diff --git a/Master/texmf-dist/tex/latex/churchslavonic/cu-kruk.sty b/Master/texmf-dist/tex/latex/churchslavonic/cu-kruk.sty new file mode 100644 index 00000000000..11dc43ccbae --- /dev/null +++ b/Master/texmf-dist/tex/latex/churchslavonic/cu-kruk.sty @@ -0,0 +1,224 @@ +\NeedsTeXFormat{LaTeX2e}% +\RequirePackage{keyval}% +\RequirePackage{ifluatex}% +\RequirePackage{cu-kinovar}% +\ProvidesPackage{cu-kruk}[2019/04/20 v0.2 support for kruk music notations]% +% +%% 'autocolormarks' and noautocolormarks options +\newif\ifcu@autocolormarks +\ifluatex + \cu@autocolormarkstrue +\else + \cu@autocolormarksfalse +\fi + +\DeclareOption{autocolormarks}{ + \cu@autocolormarkstrue + \ifluatex\relax\else\message{WARNING: autocolormarks option may not work correctly with this TeX engine. See documentation for more details.}\fi +} +\DeclareOption{noautocolormarks}{ + \cu@autocolormarksfalse +} + +\ProcessOptions\relax + +\let\cuKrukFont\relax %% to be defined by the user +% +\newlength{\cuKrukSylSpace} %% spacing around kruk syllable +\newlength{\cuKrukTopMargin} %% top margin ensures that lines are nicely separated +\newlength{\cuKrukSylRuleHeight} %% how thick placeholder rule is +\newlength{\cuKrukRaise} %% distance between text and kruk baselines +% +\setlength{\cuKrukSylSpace}{0.2em} +\setlength{\cuKrukTopMargin}{0.3em} +\setlength{\cuKrukSylRuleHeight}{0.08em} +\setlength{\cuKrukRaise}{1em} + +\define@key{cuKruk}{krukFont}{\def\cuKrukFont{#1}}% +\define@key{cuKruk}{sylSpace}{\setlength{\cuKrukSylSpace}{#1}}% +\define@key{cuKruk}{topMargin}{\setlength{\cuKrukTopMargin}{#1}}% +\define@key{cuKruk}{sylRuleHeight}{\setlength{\cuKrukSylRuleHeight}{#1}}% +\define@key{cuKruk}{krukRaise}{\setlength{\cuKrukRaise}{#1}}% +\define@boolkey{cuKruk}{invertColor}[true]{}% + +\newcommand{\cuKruk}[3][]{% + \bgroup + \setkeys{cuKruk}{#1}% + \cu@@Kruk{#2}{#3}% + \egroup +}% +\def\cu@@Kruk#1#2{{% + \edef\cu@tmp{\csname \detokenize{#2}cu@@@\endcsname}% + \setbox1=\hbox{{% + \ifKV@cuKruk@invertColor + \colorlet{tmp}{.}\color{kinovar}\colorlet{kinovar}{tmp}% + \fi + \cuKrukFont#1% + }}% + \dimen0=\ht1\advance\dimen0 by \cuKrukTopMargin\ht1=\dimen0% + \if\relax\detokenize{#2}\relax + \setbox2=\hbox{\vrule height \cuKrukSylRuleHeight width \wd1}% + \else + \ifx\cu@tmp\cu@Tilda + \setbox2=\hbox{\vrule height \cuKrukSylRuleHeight width \wd1}% + \else + \setbox2=\hbox{#2}% + \fi + \fi + \ifdim\wd1>\wd2% + \setbox2=\hbox to \wd1{\hss\box2\hss}% + \fi + %\discretionary{}{}{}% + \hskip\cuKrukSylSpace\penalty5000\hbox to \wd2{% + \hskip0.5\wd2\hskip-0.5\wd1\raise\cuKrukRaise\copy1\kern-0.5\wd2\kern-0.5\wd1\copy2\hss + }\penalty10000\hskip\cuKrukSylSpace +}}% +% +\newlength{\cuSupRaise} %% controls extra vertical space between Sup and Base +\setlength{\cuSupRaise}{0ex} +\define@key{cuSup}{raise}{\setlength{\cuSupRaise}{#1}}% + +\newcommand{\cuSup}[3][]{% + \bgroup + \setkeys{cuSup}{#1}% + \cu@@Sup{#2}{#3}% + \egroup +}% +\def\cu@@Sup#1#2{{% + \leavevmode + \setbox1=\hbox{#1}% + \setbox2=\hbox{#2}% + \dimen0=\ht2% + \advance\dimen0 by \dp1% + \message{\the\dimen0}% + \advance\dimen0 by \cuSupRaise + \advance\dimen0 by -0.25\ht1% + \hbox to \wd2{% + \hskip0.5\wd2\hskip-0.5\wd1\raise\dimen0\copy1\kern-0.5\wd2\kern-0.5\wd1\copy2\hss + }% +}} +% +\newcounter{cu@KrukPos}% +\newcounter{cu@SylPos}% +% +\newcommand{\cuKrukPara}[2][]{% + \cu@KrukPara[#1]#2\cu@End +}% +% +\def\cu@KrukPara[#1]#2\\#3\cu@End{% +\bgroup +\setkeys{cuKruk}{#1}% +\setcounter{cu@KrukPos}{0}% +\setcounter{cu@SylPos}{0}% +\cu@Kruk #2 \cu@EndKruk +\cu@Text #3 \cu@EndText +\ifnum\thecu@SylPos<\thecu@KrukPos\errmessage{Too many kruk groups. Seen {\thecu@KrukPos} kruk groups and {\thecu@SylPos} text groups}\fi +\egroup +}% +% +\def\cu@Kruk#1 #2\cu@EndKruk{% +\if\relax\detokenize{#1}\relax\else +\cu@KrukAction{#1}% +\fi +\if\relax\detokenize{#2}\relax\else + \cu@Kruk#2\cu@EndKruk +\fi +}% +% +\def\cu@KrukAction#1{% +\edef\cu@tmp{\csname \detokenize{#1}cu@@@\endcsname}% +\ifx\cu@tmp\cu@Tilda + \expandafter\edef\csname cu@@\thecu@KrukPos\endcsname{}% +\else + \expandafter\def\csname cu@@\thecu@KrukPos\endcsname{#1}% +\fi +\stepcounter{cu@KrukPos}% +} +% +\edef\cu@Tilda{\csname \detokenize{~}cu@@@\endcsname}% +\edef\cu@Empty{\csname \detokenize{}cu@@@\endcsname}% +% +\def\cu@Text#1 #2\cu@EndText{% +\if\relax\detokenize{#1}\relax\else + \cu@TextDash#1-\cu@EndText\space +\fi +\if\relax\detokenize{#2}\relax\else + \cu@Text#2\cu@EndText +\fi +}% +% +\def\cu@TextDash#1-#2\cu@EndText{% +\cu@TextAction{#1}% +\if\relax\detokenize{#2}\relax\else + \cu@TextDash#2\cu@EndText +\fi +}% +% +\def\cu@TextAction#1{% +\ifnum\thecu@SylPos>\thecu@KrukPos + \errmessage{Too few kruk groups. Seen {\thecu@KrukPos} kruk groups and {\thecu@SylPos} text groups}% +\fi +\edef\cu@tmp{\csname \detokenize{#1}cu@@@\endcsname}% +\ifx\cu@tmp\cu@Empty + \expandafter\cuKruk\expandafter{\csname cu@@\thecu@SylPos\endcsname}{}% +\else + \ifx\cu@tmp\cu@Tilda + \expandafter\cuKruk\expandafter{\csname cu@@\thecu@SylPos\endcsname}{}% + \else + \expandafter\cuKruk\expandafter{\csname cu@@\thecu@SylPos\endcsname}{#1}% + \fi +\fi +\stepcounter{cu@SylPos}% +}% +% +% Automatic coloring of kruk marks (pomety) +\ifcu@autocolormarks +\catcode`𜼀\active\def𜼀{\cuKinovar{\detokenize{𜼀}}}% +\catcode`𜼁\active\def𜼁{\cuKinovar{\detokenize{𜼁}}}% +\catcode`𜼂\active\def𜼂{\cuKinovar{\detokenize{𜼂}}}% +\catcode`𜼃\active\def𜼃{\cuKinovar{\detokenize{𜼃}}}% +\catcode`𜼄\active\def𜼄{\cuKinovar{\detokenize{𜼄}}}% +\catcode`𜼅\active\def𜼅{\cuKinovar{\detokenize{𜼅}}}% +\catcode`𜼆\active\def𜼆{\cuKinovar{\detokenize{𜼆}}}% +\catcode`𜼇\active\def𜼇{\cuKinovar{\detokenize{𜼇}}}% +\catcode`𜼈\active\def𜼈{\cuKinovar{\detokenize{𜼈}}}% +\catcode`𜼉\active\def𜼉{\cuKinovar{\detokenize{𜼉}}}% +\catcode`𜼊\active\def𜼊{\cuKinovar{\detokenize{𜼊}}}% +\catcode`𜼋\active\def𜼋{\cuKinovar{\detokenize{𜼋}}}% +\catcode`𜼌\active\def𜼌{\cuKinovar{\detokenize{𜼌}}}% +\catcode`𜼍\active\def𜼍{\cuKinovar{\detokenize{𜼍}}}% +\catcode`𜼎\active\def𜼎{\cuKinovar{\detokenize{𜼎}}}% +\catcode`𜼏\active\def𜼏{\cuKinovar{\detokenize{𜼏}}}% +\catcode`𜼐\active\def𜼐{\cuKinovar{\detokenize{𜼐}}}% +\catcode`𜼑\active\def𜼑{\cuKinovar{\detokenize{𜼑}}}% +\catcode`𜼒\active\def𜼒{\cuKinovar{\detokenize{𜼒}}}% +\catcode`𜼓\active\def𜼓{\cuKinovar{\detokenize{𜼓}}}% +\catcode`𜼔\active\def𜼔{\cuKinovar{\detokenize{𜼔}}}% +\catcode`𜼕\active\def𜼕{\cuKinovar{\detokenize{𜼕}}}% +\catcode`𜼖\active\def𜼖{\cuKinovar{\detokenize{𜼖}}}% +\catcode`𜼗\active\def𜼗{\cuKinovar{\detokenize{𜼗}}}% +\catcode`𜼘\active\def𜼘{\cuKinovar{\detokenize{𜼘}}}% +\catcode`𜼙\active\def𜼙{\cuKinovar{\detokenize{𜼙}}}% +\catcode`𜼚\active\def𜼚{\cuKinovar{\detokenize{𜼚}}}% +\catcode`𜼛\active\def𜼛{\cuKinovar{\detokenize{𜼛}}}% +\catcode`𜼜\active\def𜼜{\cuKinovar{\detokenize{𜼜}}}% +\catcode`𜼝\active\def𜼝{\cuKinovar{\detokenize{𜼝}}}% +\catcode`𜼞\active\def𜼞{\cuKinovar{\detokenize{𜼞}}}% +\catcode`𜼟\active\def𜼟{\cuKinovar{\detokenize{𜼟}}}% +\catcode`𜼠\active\def𜼠{\cuKinovar{\detokenize{𜼠}}}% +\catcode`𜼡\active\def𜼡{\cuKinovar{\detokenize{𜼡}}}% +\catcode`𜼢\active\def𜼢{\cuKinovar{\detokenize{𜼢}}}% +\catcode`𜼣\active\def𜼣{\cuKinovar{\detokenize{𜼣}}}% +\catcode`𜼤\active\def𜼤{\cuKinovar{\detokenize{𜼤}}}% +\catcode`𜼥\active\def𜼥{\cuKinovar{\detokenize{𜼥}}}% +\catcode`𜼦\active\def𜼦{\cuKinovar{\detokenize{𜼦}}}% +\catcode`𜼧\active\def𜼧{\cuKinovar{\detokenize{𜼧}}}% +\catcode`𜼨\active\def𜼨{\cuKinovar{\detokenize{𜼨}}}% +\catcode`𜼩\active\def𜼩{\cuKinovar{\detokenize{𜼩}}}% +\catcode`𜼪\active\def𜼪{\cuKinovar{\detokenize{𜼪}}}% +\catcode`𜼫\active\def𜼫{\cuKinovar{\detokenize{𜼫}}}% +\catcode`𜼬\active\def𜼬{\cuKinovar{\detokenize{𜼬}}}% +\catcode`𜼭\active\def𜼭{\cuKinovar{\detokenize{𜼭}}}% +\fi +% +\endinput% diff --git a/Master/texmf-dist/tex/latex/churchslavonic/cu-num.sty b/Master/texmf-dist/tex/latex/churchslavonic/cu-num.sty index 1a84190eadf..3cd16d6455b 100644 --- a/Master/texmf-dist/tex/latex/churchslavonic/cu-num.sty +++ b/Master/texmf-dist/tex/latex/churchslavonic/cu-num.sty @@ -1,7 +1,7 @@ % Copyright 2016 Slavonic Computing Initialive % http://sci.ponomar.net % -\ProvidesPackage{cu-num}[2016/03/03 v1.0 CU Numerics] +\ProvidesPackage{cu-num}[2016/03/03 v1.1 CU Numerics] \@ifundefined{detokenize}{% \PackageError{cu-num}% @@ -20,17 +20,17 @@ \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@firstoffour\cu@repeat #1\stop@ #2#3#4#5{#2}% +\def\cu@firstofthree\cu@repeat@i #1\stop@ #2#3#4{#2}% \def\cu@switch #1{% \if\relax\detokenize{#1}\relax - \expandafter\@firstoffour + \expandafter\cu@firstoffour \fi \cu@repeat #1\stop@ }% \def\cu@repeat #1#2\stop@ #3{% \if\relax\detokenize{#2}\relax - \expandafter\@firstofthree + \expandafter\cu@firstofthree \fi \cu@repeat@i #2\stop@ }% |