summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-ext/biblatex-ext-oasymb-l3draw.sty
blob: 9ed5ad5517a03f115f77f203e1480949e9196e20 (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
\RequirePackage{expl3}

\ProvidesExplPackage {biblatex-ext-oasymb-l3draw}
  {2020/08/09} {0.8g}
  {open access symbols with l3draw (MW)}

\RequirePackage{xparse}
\RequirePackage{l3keys2e}
\RequirePackage{l3color}
\RequirePackage{l3draw}

\msg_new:nnn { biblatex-ext-oasymb-l3draw } { OutdatedL3Draw }
  { Your~versions~of~'l3color'~and~'l3draw~do~not~support~
    '\token_to_str:N\color_fill:n'. \\
    Please~update~'l3color'~and~'l3draw'~to~version~2020-08-07~or~above.\\
    Limited~support~for~older~versions~with~
    '\token_to_str:N\draw_color_fill:n'~is~available,~
    but~not~tested~extensively.
  }

\cs_if_exist:NTF \color_fill:n
  { \cs_set_eq:NN \__extblx_color_fill:n \color_fill:n }
  {
     \msg_warning:nn {biblatex-ext-oasymb-l3draw} {OutdatedL3Draw}
     \cs_set_eq:NN \__extblx_color_fill:n \draw_color_fill:n
  }

% PLoS Open Access symbol based on
% https://commons.wikimedia.org/wiki/File:Open_Access_logo_PLoS_white.svg
% public domain/CC0 by PLoS & Wikipedia users Nina, Beao and JakobVoss

\color_set:nnn {oasymb_plos_orange} {cmyk} {0, .47, .93, .04}
\dim_const:Nn \l__extblx_oasymb_scale_plos_dim {.1pt}

\cs_new_protected:Nn \__extblx_oasymb_plos_path:
{
  \draw_begin:
    \draw_path_moveto:n { 47*\l__extblx_oasymb_scale_plos_dim,
                          73*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_arc:nnn { 000 } { 180 } { 15*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_lineto:n {  6*\l__extblx_oasymb_scale_plos_dim,
                          73*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_arc:nnn { 180 } { 000 } { 26*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_rectangle_corners:nn { 47*\l__extblx_oasymb_scale_plos_dim,
                                      47*\l__extblx_oasymb_scale_plos_dim }
                                    { 58*\l__extblx_oasymb_scale_plos_dim,
                                      73*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_moveto:n { 64*\l__extblx_oasymb_scale_plos_dim,
                          32*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_arc:nnn { 000 } { 360 } { 32*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_moveto:n { 53*\l__extblx_oasymb_scale_plos_dim,
                          32*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_arc:nnn { 360 } { 000 } { 21*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_moveto:n { 41*\l__extblx_oasymb_scale_plos_dim,
                          32*\l__extblx_oasymb_scale_plos_dim }
    \draw_path_arc:nnn { 000 } { 360 } { 09*\l__extblx_oasymb_scale_plos_dim }
    \__extblx_color_fill:n { oasymb_plos_orange }
    \draw_path_use_clear:n { fill }
  \draw_end:
}


\box_new:N \l__extblx_oasymb_plos_box

\hbox_set:Nn \l__extblx_oasymb_plos_box { \__extblx_oasymb_plos_path: }

\NewDocumentCommand \extblx_oasymb_draw_plos { }
{
  \mode_leave_vertical:
  \box_use:N \l__extblx_oasymb_plos_box
}

% LaTeX2e name
\cs_set_eq:NN \extblx@oasymb@draw@plos \extblx_oasymb_draw_plos

% PLoS symbols is standard
\NewExpandableDocumentCommand \oasymbol { } { \extblx_oasymb_draw_plos }

% Open-Acess.net Open Acess symbol
% redrawn in l3draw from
% http://open-access.net/fileadmin/logos/oa.svg
% public domain according to
% https://commons.wikimedia.org/wiki/File:Open_access.svg
% might be covered by open-access.net's overall CC-BY 4.0 license
% (https://creativecommons.org/licenses/by/4.0/)
% see https://open-access.net/impressum/
% the site states no specific conditions for use of the logo
% other than
%   "Das Logo der Informationsplattform darf nachgenutzt werden,
%    gerne mit einem Link zu open-access.net"
% on https://open-access.net/ueber-uns/
% see also https://open-access.net/community/materialien/
% logo by
% Medien + Design
% Center for Digital Systems
% Competence Center for E-Learning and Multimedia
% Freie Universität Berlin
\color_set:nnn {oasymb_oanet_green}     {cmyk} {.45, 0, .49, .62}
\color_set:nnn {oasymb_oanet_gold}      {cmyk} {0, .2, .77, .02}
\color_set:nnn {oasymb_oanet_intersect} {cmyk} {.06, 0, .6, .43}
\dim_const:Nn \l__extblx_oasymb_scale_oanet_dim {1.1pt}

\cs_new_protected:Nn \__extblx_oasymb_oanet_path:
{
  \draw_begin:
    \draw_path_moveto:n { 8.3*\l__extblx_oasymb_scale_oanet_dim,
                          4  *\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_arc:nnn { 000 } { 360 } { 4.3*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_moveto:n { 6.7*\l__extblx_oasymb_scale_oanet_dim,
                          4  *\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_arc:nnn { 360 } { 000 } { 2.7*\l__extblx_oasymb_scale_oanet_dim }
    \__extblx_color_fill:n { oasymb_oanet_green }
    \draw_path_use_clear:n { fill }

    \draw_path_rectangle_corners:nn { 13.7*\l__extblx_oasymb_scale_oanet_dim,
                                       -.1*\l__extblx_oasymb_scale_oanet_dim }
                                    { 15.3*\l__extblx_oasymb_scale_oanet_dim,
                                       4  *\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_moveto:n { 13.7*\l__extblx_oasymb_scale_oanet_dim,
                             4*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_lineto:n { 15.3*\l__extblx_oasymb_scale_oanet_dim,
                           4*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_arc:nnn { 000 } { 300 } { 4.3*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_moveto:n { (11+cosd(300)*4.3)*\l__extblx_oasymb_scale_oanet_dim,
                          (4+sind(300)*4.3)*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_lineto:n { (11+cosd(300)*2.7)*\l__extblx_oasymb_scale_oanet_dim,
                          (4+sind(300)*2.7)*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_arc:nnn { 300 } { 000 } { 2.7*\l__extblx_oasymb_scale_oanet_dim }
    \__extblx_color_fill:n { oasymb_oanet_gold }
    \draw_path_use_clear:n { fill }

    \draw_path_moveto:n
      { (4+cosd(035.5)*4.3)*\l__extblx_oasymb_scale_oanet_dim,
        (4+sind(035.5)*4.3)*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_arc:nnn { 144.5 } { 215.5 }
                       { 4.3*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_moveto:n
      { (4+cosd(-035.5)*4.3)*\l__extblx_oasymb_scale_oanet_dim,
        (4+sind(-035.5)*4.3)*\l__extblx_oasymb_scale_oanet_dim }
    \draw_path_arc:nnn { -035.5 } { 035.5 }
                       { 4.3*\l__extblx_oasymb_scale_oanet_dim }
    \__extblx_color_fill:n { oasymb_oanet_intersect }
    \draw_path_use_clear:n { fill }
  \draw_end:
}


\box_new:N \l__extblx_oasymb_oanet_box

\hbox_set:Nn \l__extblx_oasymb_oanet_box { \__extblx_oasymb_oanet_path: }

\NewDocumentCommand \extblx_oasymb_draw_oanet { }
{
  \mode_leave_vertical:
  \box_use:N \l__extblx_oasymb_oanet_box
}

% LaTeX2e name
\cs_set_eq:NN \extblx@oasymb@draw@oanet \extblx_oasymb_draw_oanet

\msg_new:nnnn { biblatex-ext-oasymb-l3draw } { UnknownSymbol }
  { Unknown~symbol~'#1'.}
  { The~symbol~'#1'~does~not~exist.\\
    Please~consult~the~documentation~for~a~list~of~valid~options. }

\cs_new_protected_nopar:Nn \__extblx_oasymb_define_oasymbol:n
{
  \cs_if_exist:cTF {extblx_oasymb_draw_#1}
    { \cs_set_eq:Nc \oasymbol {extblx_oasymb_draw_#1} }
    {
      \msg_error:nnn
        {biblatex-ext-oasymb-l3draw}
        {UnknownSymbol}
        {#1}
    }
}

\cs_generate_variant:Nn \__extblx_oasymb_define_oasymbol:n {x}

\NewDocumentCommand \DefineOASymbol { O{plos} }
{
  \__extblx_oasymb_define_oasymbol:x {#1}
}


\tl_new:N \l__extblx_oasymb_symbol_tl

\keys_define:nn { biblatex-ext-oasymb-l3draw }
{
  symbol .code:n    = \DefineOASymbol[#1],
  symbol .initial:n = plos,
  plos   .value_forbidden:n = true,
  plos   .code:n            =
  {
    \keys_set:nn { biblatex-ext-oasymb-l3draw } { symbol=plos }
  },
  oanet   .value_forbidden:n = true,
  oanet   .code:n            =
  {
    \keys_set:nn { biblatex-ext-oasymb-l3draw } { symbol=oanet }
  },
}


\ProcessKeysOptions {biblatex-ext-oasymb-l3draw}


\tex_endinput:D
%
% This file is part of the biblatex-ext bundle.
% biblatex-ext is released under the LaTeX Project Public License v1.3c
% or later.
%
% A complete list of files included in that package can be found in
% README.md or - failing that - in ext-standard.bbx.
%
% Official releases of this package are on CTAN
%   https://www.ctan.org/pkg/biblatex-ext
% development takes place on GitHub
%   https://github.com/moewew/biblatex-ext
%