From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- .../biblatex-ext/biblatex-ext-oasymb-tikz.sty | 169 +++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 macros/latex/contrib/biblatex-contrib/biblatex-ext/biblatex-ext-oasymb-tikz.sty (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-ext/biblatex-ext-oasymb-tikz.sty') diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-ext/biblatex-ext-oasymb-tikz.sty b/macros/latex/contrib/biblatex-contrib/biblatex-ext/biblatex-ext-oasymb-tikz.sty new file mode 100644 index 0000000000..ec5c3c3cea --- /dev/null +++ b/macros/latex/contrib/biblatex-contrib/biblatex-ext/biblatex-ext-oasymb-tikz.sty @@ -0,0 +1,169 @@ +\ProvidesPackage{biblatex-ext-oasymb-tikz} + [2019/08/25 v0.8 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 +% -- cgit v1.2.3