summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-08-08 20:38:40 +0000
committerKarl Berry <karl@freefriends.org>2017-08-08 20:38:40 +0000
commitbb5a582a3651ea6fe3c4fce9580cc248f5953f43 (patch)
tree2db9e292c86b09339265b097a9cddfdf3fe8ff89 /Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
parent3a8846b896e8f1b37294b5cd54016bf3b6f58490 (diff)
scsnowman (8aug17)
git-svn-id: svn://tug.org/texlive/trunk@44984 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty')
-rw-r--r--Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty61
1 files changed, 41 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty b/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
index 4f8eadd01d4..3a854bffd75 100644
--- a/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
+++ b/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
@@ -10,10 +10,14 @@
%% Twitter : @aminophen
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{sctkzsym-base}[2017/01/22 v1.1 Base for emoji variants using TikZ]
+\ProvidesPackage{sctkzsym-base}[2017/08/08 v1.2 Base for emoji variants using TikZ]
\RequirePackage{tikz}
\RequirePackage{keyval}
%
+\ifx\kanjiskip\@undefined\else
+ \IfFileExists{pxeveryshi.sty}{\RequirePackage{pxeveryshi}}{}
+\fi
+%
% prepare for options
\newif\ifsctkzsym@document
\newif\ifsctkzsym@qed
@@ -55,17 +59,32 @@
\fi
%
% key definitions
+% * any value; if none, 'true' is assumed
\newcommand{\sctkzsym@define@key@withbool}[2]{%
\define@key{sctkzsym@#1}{#2}[true]{\expandafter\def\csname sctkzsym@#1@#2\endcsname{##1}}%
\expandafter\newif\csname ifsctkzsym@#1@#2\endcsname
}
+% * any value; if none, an error will be raised
\newcommand{\sctkzsym@define@key@wodefault}[2]{%
\define@key{sctkzsym@#1}{#2}{\expandafter\def\csname sctkzsym@#1@#2\endcsname{##1}}%
}
+% * one from arg #3; arg #3 should be comma-separated list of candidates
+\newcommand{\sctkzsym@define@key@withword}[3]{%
+ \define@key{sctkzsym@#1}{#2}{\expandafter\def\csname sctkzsym@#1@#2\endcsname{##1}}%
+ % register known values (used in key handling)
+ \sctkzsym@hndlcnt\z@
+ \edef\@tempa{\zap@space#3 \@empty}%
+ \@for\@tempa:=\@tempa\do{%
+ \advance\sctkzsym@hndlcnt\@ne
+ \expandafter\let\csname sctkzsym@#1@#2@\romannumeral\sctkzsym@hndlcnt\endcsname\@tempa}%
+}
+% other known values (used in key handling)
+\def\sctkzsym@true{true} % for bool strcmp
+\def\sctkzsym@false{false} % for bool strcmp
%
% key handling
-\def\sctkzsym@true{true} % for strcmp
-\def\sctkzsym@false{false} % for strcmp
+\newcount\sctkzsym@hndlcnt % for withword loop
+\let\sctkzsym@status\relax % for withword status
\newcommand{\sctkzsym@hndl@key@withbool}[2]{%
\expandafter\ifx\csname sctkzsym@#1@#2\endcsname\sctkzsym@false\relax
\csname sctkzsym@#1@#2false\endcsname % <key>=false
@@ -89,31 +108,33 @@
\fi
\fi
}
-\newcommand{\sctkzsym@hndl@key@wodefault}[5]{%
- \def\@tempa{#3}%
- \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\@tempa\relax
- \csname sctkzsym@#1@#2@c\endcsname\@ne
- \else
- \def\@tempa{#4}%
- \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\@tempa\relax
- \csname sctkzsym@#1@#2@c\endcsname\tw@
- \else
- \def\@tempa{#5}%
- \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\@tempa\relax
- \csname sctkzsym@#1@#2@c\endcsname\thr@@
- \else
- \PackageError{sc#1}{Unsupported value `\csname sctkzsym@#1@#2\endcsname' for #2}\@ehc
- \csname sctkzsym@#1@#2@c\endcsname\z@
+\newcommand{\sctkzsym@hndl@key@withword}[2]{%
+ % initialize
+ \@tempcnta\@ne
+ \let\sctkzsym@status\relax
+ % check through the registered candidate values
+ \loop\expandafter\ifx\csname sctkzsym@#1@#2@\romannumeral\@tempcnta\endcsname\relax\else
+ \ifx\sctkzsym@status\relax
+ \expandafter\ifx\csname sctkzsym@#1@#2\expandafter\endcsname
+ \csname sctkzsym@#1@#2@\romannumeral\@tempcnta\endcsname\relax
+ \def\sctkzsym@status{0}%
\fi
\fi
+ \advance\@tempcnta\@ne
+ \repeat
+ % if the status is still not zero, user-specified value is invalid; throw an error
+ \ifx\sctkzsym@status\relax
+ \PackageError{sc#1}{Unsupported value `\csname sctkzsym@#1@#2\endcsname' for #2}\@ehc
\fi
}
%
% setup for tikzpicture
\newlength{\sctkzsym@coord@baseline}
\newlength{\sctkzsym@coord@scl}
-\newcommand*{\set@sctkzsym@coord@scl}[1]{\pgfmathsetlength{\sctkzsym@coord@scl}{#1pt}}
-\newcommand{\sctkzsym@defaultcolor}{black}
+\newcommand*{\set@sctkzsym@coord@scl}[1]{\pgfmathsetlength{\sctkzsym@coord@scl}{#1\p@}}
+\newcommand{\sctkzsym@beginyokobox}{\ifx\tate\@undefined\else\leavevmode\hbox\bgroup\yoko\fi}
+\newcommand{\sctkzsym@endyokobox}{\ifx\tate\@undefined\else\egroup\fi}
+\newcommand{\sctkzsym@defaultcolor}{}
\newcommand{\sctkzsym@defaultanticolor}{white}
%
\endinput