forked from muzimuzhi/latex-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cc-icons-mapping.tex
71 lines (66 loc) · 1.74 KB
/
cc-icons-mapping.tex
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
\usepackage{expl3}
\usepackage{fontspec}
\usepackage{xparse}
\ExplSyntaxOn
\makeatletter
\newfontfamily\@cciconsFamily{cc-icons}
\msg_set:nnn { ccicons } { invalid~name }
{
CC~Icon~with~name~``#1''~does~not~exist.~Use~``cc-cc''~instead.
}
\NewDocumentCommand \ccicons { m }
{
\group_begin:
\@cciconsFamily
%% ref: https://github.com/cc-icons/cc-icons/blob/master/css/cc-icons.css
\str_case:nnF {#1}
{
%% round icons
{cc-sa} {a}
{cc-by} {b}
{cc-cc} {c}
{cc-nd} {d}
{cc-nc-eu} {e}
{cc-nc-jp} {j}
{cc-sampling} {m}
{cc-nc} {n}
{cc-zero} {o}
{cc-pd} {p}
{cc-pd-alt} {q}
{cc-remix} {r}
{cc-share} {s}
%% license banners
{cc-srr} {A}
{cc-BY} {B}
{cc-logo} {C}
{cc-by-nd} {D}
{cc-by-nc-eu} {E}
{cc-by-nc-nd-eu} {F}
{cc-by-nc-sa-eu} {G}
{cc-by-nc-jp} {J}
{cc-by-nc-nd-jp} {K}
{cc-by-nc-sa-jp} {L}
{cc-by-nc-sa} {M}
{cc-by-nc} {N}
{cc-publication} {O}
{cc-by-nc-nd} {R}
{cc-by-sa} {S}
%% small banners
{cc-ZERO-} {0}
{cc-ONE-} {1}
{cc-TWO-} {2}
{cc-THREE-} {3}
{cc-FOUR-} {4}
{cc-FIVE-} {5}
{cc-SIX-} {6}
{cc-SEVEN-} {7}
{cc-EIGHT-} {8}
{cc-NINE-} {9}
}{
\msg_error:nnn { ccicons } { invalid~name } {#1}
c
}
\group_end:
}
\makeatother
\ExplSyntaxOff