summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/scsnowman/sctkzsym-base.sty
blob: 1f313f015c56bff1ab4ec0d75712e6b7012ff805 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
%%
%% This is file `sctkzsym-base.sty', part of scsnowman package.
%% Maintained on GitHub:
%% https://github.com/aminophen/scsnowman
%%
%% Copyright (c) 2015-2016 Hironobu Yamashita
%%   Email   :  h.y.acetaminophen[a t]gmail.com
%%   GitHub  :  https://github.com/aminophen
%%   Blog    :  http://acetaminophen.hatenablog.com/
%%   Twitter :  @aminophen
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sctkzsym-base}[2016/12/22 v1.0 Base for emoji variants using TikZ]
\RequirePackage{tikz}
\RequirePackage{keyval}
%
% prepare for options
\newif\ifsctkzsym@document
\newif\ifsctkzsym@qed
\newif\ifsctkzsym@item
%
% options
\DeclareOption{documentX}{\sctkzsym@documenttrue}
\DeclareOption{nodocumentX}{\sctkzsym@documentfalse}
\DeclareOption{qedX}{\sctkzsym@qedtrue}
\DeclareOption{noqedX}{\sctkzsym@qedfalse}
\DeclareOption{itemX}{\sctkzsym@itemtrue}
\DeclareOption{noitemX}{\sctkzsym@itemfalse}
\ExecuteOptions{documentX,qedX,itemX}
\ProcessOptions\relax
%
% save QED symbol before change (joke)
\ifsctkzsym@qed
  \RequirePackage{amsthm}
  \ifx\sctkzsym@saved@qedsymbol\@undefined
    \let\sctkzsym@saved@qedsymbol\qedsymbol
  \fi
  \newcommand{\makeqedother}{%
    \let\qedsymbol\sctkzsym@saved@qedsymbol
  }
\fi
%
% save item label before change (joke)
\ifsctkzsym@item
  \let\sctkzsym@saved@labelitemi\labelitemi
  \let\sctkzsym@saved@labelitemii\labelitemii
  \let\sctkzsym@saved@labelitemiii\labelitemiii
  \let\sctkzsym@saved@labelitemiv\labelitemiv
  \newcommand{\makeitemother}{%
    \let\labelitemi\sctkzsym@saved@labelitemi
    \let\labelitemii\sctkzsym@saved@labelitemii
    \let\labelitemiii\sctkzsym@saved@labelitemiii
    \let\labelitemiv\sctkzsym@saved@labelitemiv
  }
\fi
%
% key definitions
\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
}
\newcommand{\sctkzsym@define@key@wodefault}[2]{%
  \define@key{sctkzsym@#1}{#2}{\expandafter\def\csname sctkzsym@#1@#2\endcsname{##1}}%
}
%
% key handling
\def\sctkzsym@true{true}   % for strcmp
\def\sctkzsym@false{false} % for strcmp
\newcommand{\sctkzsym@hndl@key@withbool}[2]{%
  \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\sctkzsym@false\relax
    \csname sctkzsym@#1@#2false\endcsname % <key>=false
  \else
    \csname sctkzsym@#1@#2true\endcsname  % <key>=true/<color>
    \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\sctkzsym@true\relax
      % <key>=true; <default-color>
      \expandafter\def\csname sctkzsym@#1@#2\endcsname{\sctkzsym@defaultcolor}%
    \fi
  \fi
}
\newcommand{\sctkzsym@hndl@key@onlybool}[2]{%
  \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\sctkzsym@false\relax
    \csname sctkzsym@#1@#2false\endcsname % <key>=false
  \else
    \expandafter\ifx\csname sctkzsym@#1@#2\endcsname\sctkzsym@true\relax
      \csname sctkzsym@#1@#2true\endcsname  % <key>=true
    \else
      \PackageError{sctkzsym-base}{Only true/false allowed for key `#2'}\@ehc
      \csname sctkzsym@#1@#2false\endcsname % <key>=false
    \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{sctkzsym-base}{Unsupported value `\csname sctkzsym@#1@#2\endcsname' for #2}\@ehc
        \csname sctkzsym@#1@#2@c\endcsname\z@
      \fi
    \fi
  \fi
}
%
% setup for tikzpicture
\newlength{\sctkzsym@coord@scl}
\newcommand*{\set@sctkzsym@coord@scl}[1]{\pgfmathsetlength{\sctkzsym@coord@scl}{#1pt}}
\newcommand{\sctkzsym@defaultcolor}{black}
\newcommand{\sctkzsym@defaultanticolor}{white}
%
\endinput
%%
%% End of file `sctkzsym-base.sty'.