diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/rorlink/rorlink.sty | 48 |
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 |