summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/churchslavonic/cu-kinovar.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/churchslavonic/cu-kinovar.sty')
-rw-r--r--Master/texmf-dist/tex/latex/churchslavonic/cu-kinovar.sty50
1 files changed, 30 insertions, 20 deletions
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