summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-ext/biblatex-ext-oasymb-tikz.sty
blob: 22ea6648b0420f2aeb486841ea3c27717ed85415 (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
\ProvidesPackage{biblatex-ext-oasymb-tikz}
  [2021/08/31 v0.14 open access symbols with TikZ (MW)]

\RequirePackage{etoolbox}
\RequirePackage{kvoptions}

\protected\def\extblx@oasymb@tikz@error#1#2{%
  \PackageError{biblatex-ext-oasymb-tikz}{#1}{#2.}}

\protected\def\extblx@oasymb@tikz@warning@noline{%
  \PackageWarningNoLine{biblatex-ext-oasymb-tikz}}

\let\extblx@oasymb@tikz@warning\extblx@oasymb@tikz@warning@noline
\AtEndOfPackage{%
  \protected\def\extblx@oasymb@tikz@warning{%
    \PackageWarning{biblatex-ext-oasymb-tikz}}}

\RequirePackage{tikz}

% 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
\definecolor{extblx@oasymb@tikz@plos@orange}{HTML}{f68212}
\newcommand*{\extblx@oasymb@tikz@plos@tikz}{%
  \begin{tikzpicture}[x=.1pt,y=.1pt]
    \begin{scope}
      \clip (06,73) rectangle ++(52,26);
      \fill[extblx@oasymb@tikz@plos@orange, even odd rule]
        (32,73) circle[radius=26]
        (32,73) circle[radius=15];
    \end{scope}
    \fill[extblx@oasymb@tikz@plos@orange, even odd rule]
      (32,32) circle[radius=32]
      (32,32) circle[radius=21]
      (32,32) circle[radius= 9];
    \fill[extblx@oasymb@tikz@plos@orange]
      (47,47) rectangle ++ (11,26);
  \end{tikzpicture}%
}

\newsavebox{\extblx@oasymb@tikz@plos@box}
\sbox{\extblx@oasymb@tikz@plos@box}{\extblx@oasymb@tikz@plos@tikz}
\newcommand*{\extblx@oasymb@tikz@plos}{%
  \usebox{\extblx@oasymb@tikz@plos@box}}

% PLoS symbols is standard
\newcommand*{\oasymbol}{\extblx@oasymb@tikz@plos}

% Open-Acess.net Open Acess symbol
% redrawn with TikZ 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
\definecolor{extblx@oasymb@tikz@oanet@green}{HTML}{356031}
\definecolor{extblx@oasymb@tikz@oanet@gold}{HTML}{f9c63a}
\definecolor{extblx@oasymb@tikz@oanet@intersect}{HTML}{89923a}

\newcommand*{\extblx@oasymb@tikz@oanet@tikz}{%
  \begin{tikzpicture}[x=1.1pt,y=1.1pt]
    \fill[extblx@oasymb@tikz@oanet@green, even odd rule]
      ( 4,4) circle[radius=4.3]
      ( 4,4) circle[radius=2.7];
    \begin{scope}
      \clip % this is *terrible*, but it was the only way I could stop
            % some viewers from adding thin lines that shouldn't be there
        (11,4) circle[radius=2.7]
        -- +(-4.3,-4.3) -- +(-4.3,+4.3) -- +(+4.3,+4.3) -- +(+4.3,-4.3)
        -- +(-4.3,-4.3);
      \fill[extblx@oasymb@tikz@oanet@gold, even odd rule]
        (11,4) ++ (0:4.3) arc (0:300:4.3) -- (11,4) ++ (300:4.3) -- cycle
        (11,4) ++ (0:2.7) arc (0:300:2.7) -- (11,4) ++ (300:2.7) -- cycle;
    \end{scope}
    \begin{scope}
      \clip                                  ( 4,4) circle[radius=4.3];
      \fill[extblx@oasymb@tikz@oanet@intersect] (11,4) circle[radius=4.3];
    \end{scope}
    \fill[extblx@oasymb@tikz@oanet@gold]
      (11,4) ++ (2.7,.1) rectangle ++(1.6,-4.1);
  \end{tikzpicture}%
}

\newsavebox{\extblx@oasymb@tikz@oanet@box}
\sbox{\extblx@oasymb@tikz@oanet@box}{\extblx@oasymb@tikz@oanet@tikz}
\newcommand*{\extblx@oasymb@tikz@oanet}{%
  \usebox{\extblx@oasymb@tikz@oanet@box}}

\protected\def\extblx@oasymb@tikz@opt@symbol@process#1{%
  \begingroup
  \edef\extblx@oasymb@tikz@tempa{\endgroup
    \noexpand\extblx@oasymb@tikz@opt@symbol@process@i{#1}}%
  \extblx@oasymb@tikz@tempa}

\def\extblx@oasymb@tikz@opt@symbol@process@i#1{%
  \ifcsundef{extblx@oasymb@tikz@#1}
    {\extblx@oasymb@tikz@error
      {Unknown value\MessageBreak
       \space\space'#1'\MessageBreak
       for option 'symbol'}
      {The symbol '#1' does not exist.\MessageBreak
       Please consult the documentation for a list of valid options}}
    {\edef\oasymbol{%
       \expandonce{\csname extblx@oasymb@tikz@#1\endcsname}}}}

\newrobustcmd*{\DefineTikZOASymbol}{%
  \extblx@oasymb@tikz@warning{%
    The command '\string\DefineTikZOASymbol'\MessageBreak
    is deprecated.\MessageBreak
    Use '\string\DefineOASymbol' instead.\MessageBreak
    Using '\string\DefineOASymbol'}%
  \DefineOASymbol}

\newrobustcmd*{\DefineOASymbol}[1][plos]{%
  \begingroup
  \edef\extblx@oasymb@tikz@tempa{\endgroup
    \noexpand\extblx@oasymb@tikz@DefineOASymbol@i{#1}}%
  \extblx@oasymb@tikz@tempa}

\protected\def\extblx@oasymb@tikz@DefineOASymbol@i#1{%
  \ifcsundef{extblx@oasymb@tikz@#1}
    {\extblx@oasymb@tikz@error
      {Unknown symbol option\MessageBreak
       \space\space'#1'}
      {The symbol '#1' does not exist.\MessageBreak
       Please consult the documentation for a list of valid options}}
    {\edef\oasymbol{%
       \expandonce{\csname extblx@oasymb@tikz@#1\endcsname}}}}

\SetupKeyvalOptions{
  family=extblx@oasymb@tikz@opt,
  prefix=extblx@oasymb@tikz@opt@,
}

\DeclareStringOption[plos]{symbol}
\DeclareVoidOption{plos}{\csdef{extblx@oasymb@tikz@opt@symbol}{plos}}
\DeclareVoidOption{oanet}{\csdef{extblx@oasymb@tikz@opt@symbol}{oanet}}

\ProcessKeyvalOptions*

\extblx@oasymb@tikz@opt@symbol@process{%
  \csuse{extblx@oasymb@tikz@opt@symbol}}

\endinput
%
% 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
%