summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/doibanner
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-07-24 19:49:48 +0000
committerKarl Berry <karl@freefriends.org>2024-07-24 19:49:48 +0000
commit80fd2302f3eeec7e068be172ea988af79087e15e (patch)
tree986f601b46bb017831e3e1c90dae120673c0c3b0 /Master/texmf-dist/tex/latex/doibanner
parent17ca906a2ce33be1e710bd0c26336e0a9944b1ca (diff)
doibanner (24jul24)
git-svn-id: svn://tug.org/texlive/trunk@71892 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/doibanner')
-rw-r--r--Master/texmf-dist/tex/latex/doibanner/doibanner.sty94
1 files changed, 94 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/doibanner/doibanner.sty b/Master/texmf-dist/tex/latex/doibanner/doibanner.sty
new file mode 100644
index 00000000000..af9267c1d19
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/doibanner/doibanner.sty
@@ -0,0 +1,94 @@
+%%
+%% This is file `doibanner.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% doibanner.dtx (with options: `package')
+%%
+%% Copyright (C) 2024 Christian Schreinemachers
+%%
+%% This work may be distributed and/or modified under the conditions
+%% of the LaTeX Project Public License, either version 1.3c of this
+%% license or (at your option) any later version. The latest version
+%% of this license is in
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008-05-04 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The current maintainer of this work is
+%% Christian Schreinemachers.
+%%
+%% This work consists of the files
+%% doibanner.dtx
+%% doibanner.ins
+%% and the derived files
+%% doibanner.sty
+%% doibanner.pdf
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{doibanner}
+ [2024-07-23 v0.2 Generate DOI banners and links]
+\RequirePackage{adjustbox}
+\RequirePackage{hyperref}
+\RequirePackage{kvoptions}
+\RequirePackage{tikz}
+\RequirePackage{xparse}
+\SetupKeyvalOptions{family=doibanner,prefix=doibanner@}
+\DeclareStringOption[https://doi.org/]{urlbase}
+\ProcessKeyvalOptions{doibanner}
+\NewDocumentCommand\doiurl{s m}{%
+ \IfBooleanTF#1
+ {\doibanner@urlbase#2}%
+ {\href{\doibanner@urlbase#2}{#2}}%
+}
+\definecolor{leftcolor}{RGB}{85,85,85}
+\definecolor{rightcolor}{RGB}{0,126,198}
+\definecolor{topcolor}{RGB}{59,59,59}
+\definecolor{bottomtextcolor}{RGB}{60,60,60}
+\NewDocumentCommand\doibanner@draw{ O{width=3.6cm} m}{%
+ \adjustbox{#1}{%
+ \begin{tikzpicture}
+ \fill [leftcolor,draw]
+ (1.5,0) --
+ ++(0,.8) {[rounded corners=5] --
+ ++(-1.5,0) --
+ ++(0,-.8)} --
+ cycle
+ {};
+ \node[bottomtextcolor] at (.75,.35) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large DOI}};
+ \node[white] at (.75,.4) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large DOI}};
+ \fill [rightcolor,draw]
+ (1.5,0) {[rounded corners=5] --
+ ++(6.5,0) --
+ ++(0,.8)} --
+ ++(-6.5,0) --
+ cycle
+ {};
+ \node[bottomtextcolor] at (4.75,.35) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large #2}};
+ \node[white] at (4.75,.4) {{\fontfamily{\sfdefault}\selectfont\bfseries \Large #2}};
+ \fill [topcolor,draw,opacity=0.1]
+ (0,0) [rounded corners=5] --
+ ++(8,0) --
+ ++(0,.8) --
+ ++(-8,0) --
+ cycle
+ {};
+ \end{tikzpicture}
+ \hspace{-4mm}
+ \vspace{-4mm}
+ }
+}
+\NewDocumentCommand\doibanner{s m}{%
+ \IfBooleanTF#1
+ {\doibanner@draw{#2}}%
+ {\href{\doibanner@urlbase#2}{\doibanner@draw{#2}}}%
+}
+\endinput
+%%
+%% End of file `doibanner.sty'.