summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-06-24 20:00:04 +0000
committerKarl Berry <karl@freefriends.org>2023-06-24 20:00:04 +0000
commitd98a8a9f785af9fbd66b72740983af96f805852b (patch)
tree4d895499e9f91778c3d4e871d6ff1edafe901ad4 /Master/texmf-dist/tex
parent3831fdfcb40d3559edf93281318bfdfc48a6ca72 (diff)
rorlink (24jun23)
git-svn-id: svn://tug.org/texlive/trunk@67461 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/rorlink/rorlink.sty48
1 files changed, 36 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/latex/rorlink/rorlink.sty b/Master/texmf-dist/tex/latex/rorlink/rorlink.sty
index e34fa5e9506..e9937d98602 100644
--- a/Master/texmf-dist/tex/latex/rorlink/rorlink.sty
+++ b/Master/texmf-dist/tex/latex/rorlink/rorlink.sty
@@ -11,7 +11,7 @@
%% Copyright (C) 2023 by Florian Lukas <florian.lukas@dainst.de>
%% --------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
+%% 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
@@ -20,14 +20,21 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{rorlink}
- [2023/06/15 1.0.0 Linked ROR logo macro package]
-%% The code is derived mainly from the orcidlink package https://github.com/duetosymmetry/orcidlink-LaTeX-command
+ [2023/06/23 1.1.0 Linked ROR logo macro package]
+%% Required packages
\RequirePackage{hyperref}
\RequirePackage{tikz}
+\RequirePackage{xparse}
+\RequirePackage{etoolbox}
+%% Set standard color of the ROR institution
+\definecolor{rorlogocol}{HTML}{53BAA1}
+%% Set global option |blackwhite| for depicting the logo only in black and white.
+\DeclareOption{blackwhite}{\definecolor{rorlogocol}{HTML}{000000}}
+\DeclareOption*{\PackageWarning{rorlink}{Unknown option -- \CurrentOption --}}
\ProcessOptions\relax
+%% Load tikz library for processing svg-paths.
\usetikzlibrary{svg.path}
-\definecolor{rorlogocol}{HTML}{53BAA1}
-%% The original svg-path received from the file https://raw.githubusercontent.com/ror-community/ror-logos/main/ror-icon-rgb.svg
+%% The original svg-path received from the file \url{https://raw.githubusercontent.com/ror-community/ror-logos/main/ror-icon-rgb.svg}
\tikzset{
rorlogo/.pic={
\fill[rorlogocol] svg{M68.65,4.16L56.52,22.74L44.38,4.16L68.65,4.16Z}
@@ -39,17 +46,34 @@ svg{M95.14,115.47L107.28,96.88L119.41,115.47L95.14,115.47Z};
}
%% The original height of the svg file is 119.27pt. The macro here uses 1/119.27 as unit.
\newcommand{\@OrigHeightRecipROR}{0.008384338}
-%% The logo is adjusted to the used font size
+%% The logo is adjusted to the used font size and an optional option |blackwhite| for depicting the logo in only black and white colors is set.
\newlength{\@curXheightROR}
-\DeclareRobustCommand\rorlink[1]{%
+\DeclareDocumentCommand\rorlink{om}{%
+\IfNoValueTF{#1}{%
+\texorpdfstring{%
+\setlength{\@curXheightROR}{\fontcharht\font`X}%
+\href{#2}{\XeTeXLinkBox{\mbox{%
+\begin{tikzpicture}[yscale=-\@OrigHeightRecipROR*\@curXheightROR,%
+xscale=\@OrigHeightRecipROR*\@curXheightROR,transform shape]%
+\pic{rorlogo};%
+\end{tikzpicture}%
+}}}}{}%
+}{%
+\ifstrequal{#1}{blackwhite}{%
+\begingroup%
+\definecolor{rorlogocol}{HTML}{000000}
\texorpdfstring{%
\setlength{\@curXheightROR}{\fontcharht\font`X}%
-\href{#1}{\XeTeXLinkBox{\mbox{%
-\begin{tikzpicture}[yscale=-\@OrigHeightRecipROR*\@curXheightROR,
-xscale=\@OrigHeightRecipROR*\@curXheightROR,transform shape]
-\pic{rorlogo};
+\href{#2}{\XeTeXLinkBox{\mbox{%
+\begin{tikzpicture}[yscale=-\@OrigHeightRecipROR*\@curXheightROR,%
+xscale=\@OrigHeightRecipROR*\@curXheightROR,transform shape]%
+\pic{rorlogo};%
\end{tikzpicture}%
-}}}}{}}
+}}}}{}%
+\endgroup%
+}{\PackageWarning{rorlink}{The defined optional argument is unknown, thus, set to blank.}{\rorlink{#2}}}%
+}%
+}%
\endinput% \end{macrocode}
\endinput