summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/rorlink
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-06-25 03:00:46 +0000
committerNorbert Preining <norbert@preining.info>2023-06-25 03:00:46 +0000
commitaf81f7c9824b89002c882d1425479009b3186b4b (patch)
treea5f3286a662dd9cc12267c3a35f91c3895c5e5f1 /macros/latex/contrib/rorlink
parent36c52277a7e7e1b9f3de0286cfd1f5931a60d802 (diff)
CTAN sync 202306250300
Diffstat (limited to 'macros/latex/contrib/rorlink')
-rw-r--r--macros/latex/contrib/rorlink/README.md6
-rw-r--r--macros/latex/contrib/rorlink/rorlink.dtx83
-rw-r--r--macros/latex/contrib/rorlink/rorlink.ins4
-rw-r--r--macros/latex/contrib/rorlink/rorlink.pdfbin234620 -> 228341 bytes
4 files changed, 70 insertions, 23 deletions
diff --git a/macros/latex/contrib/rorlink/README.md b/macros/latex/contrib/rorlink/README.md
index 763408ceae..543a10375f 100644
--- a/macros/latex/contrib/rorlink/README.md
+++ b/macros/latex/contrib/rorlink/README.md
@@ -1,12 +1,16 @@
# *RORLINK* – A LaTeX Package for Linking ROR's
+*by Florian Lukas, florian.lukas@dainst.de*
+
This repo provides a LaTeX package to automatically create an inline [ROR](https://ror.org/)-symbol which links to a given ROR-institution.
The code is derived mainly from the [Orcidlink package](https://github.com/duetosymmetry/orcidlink-LaTeX-command) by Leo Stein, which itself rests on the [Tex.SE answer](https://tex.stackexchange.com/questions/445563/ieeetran-how-to-include-orcid-in-tex-pdf-with-pdflatex/445583#445583) by the user Milo. My edits are only minor changes; especially the addition of the svg-path for the ROR symbol.
## Installation
-To use the package just copy the `rorlink.sty` file into your current LaTeX working directory. You also can copy it directly into your `texmf` tree. This may need **root** privileges.
+The package is official available on [CTAN](https://www.ctan.org/pkg/rorlink). It can be easily donwloaded there.
+
+Or copy the `rorlink.sty` file from GitLab into your current LaTeX working directory. You also can copy it directly into your `texmf` tree. This may need **root** privileges.
## Usage
diff --git a/macros/latex/contrib/rorlink/rorlink.dtx b/macros/latex/contrib/rorlink/rorlink.dtx
index 4e169fd189..2a5daca2ef 100644
--- a/macros/latex/contrib/rorlink/rorlink.dtx
+++ b/macros/latex/contrib/rorlink/rorlink.dtx
@@ -3,7 +3,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
@@ -26,13 +26,14 @@
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{rorlink}
%<*package>
- [2023/06/15 1.0.0 Linked ROR logo macro package]
+ [2023/06/23 1.1.0 Linked ROR logo macro package]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{rorlink}[2023/06/15]
\usepackage{orcidlink}
+\usepackage{xurl}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
@@ -44,7 +45,7 @@
%</driver>
% \fi
%
-% \CheckSum{31}
+% \CheckSum{62}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -64,6 +65,7 @@
%
%
% \changes{1.0.0}{2023/06/15}{Build documentation and sty}
+% \changes{1.1.0}{2023/06/23}{Updated command syntax and implementation of optional arguments for a black and white logo}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
@@ -98,13 +100,24 @@
%
%Furthermore, it can be included into larger macros; for instance, to create an author section with all necessary informations of the contributors:
%
-%\includegraphics[width=0.7\textwidth]{example_authorsection.png}
%
-% \section{Required Packages}
+%
+%\section{Optional Arguments}
+%
+%There are two possibilities of using an optional argument |blackwhite|
+%
+%\DescribeMacro{\usepackage[blackwhite]{rorlink}}\par
+%The option |blackwhite| can be set globally in the praeambel. Then every ROR link will appear in black and white only.
+%
+%\DescribeMacro{\rorlink[blackwhite]\marg{ror-link}}\par
+%The option |blackwhite| can be set as argument if you use the |\rorlink| macro inline. Then only the current symbol will appear in black and white.
+%
+%\section{Required Packages}
%
%\begin{description}
% \item[hyperref] Needed to use the symbol as a link to the particular ROR webpage.
% \item[tikz] Is used to draw the ROR symbol using the svg-path method and process the image, when the |\rorlink| command is called.
+% \item[etoolbox] For the conditioning of the optional argument uses in inline commands.
%\end{description}
%
% \StopEventually{}
@@ -115,15 +128,28 @@
%<*package>
% \fi
%
-%% The code is derived mainly from the orcidlink package https://github.com/duetosymmetry/orcidlink-LaTeX-command
+%% Required packages
% \begin{macrocode}
\RequirePackage{hyperref}
\RequirePackage{tikz}
+\RequirePackage{xparse}
+\RequirePackage{etoolbox}
+% \end{macrocode}
+%% Set standard color of the ROR institution
+% \begin{macrocode}
+\definecolor{rorlogocol}{HTML}{53BAA1}
+% \end{macrocode}
+%% Set global option |blackwhite| for depicting the logo only in black and white.
+% \begin{macrocode}
+\DeclareOption{blackwhite}{\definecolor{rorlogocol}{HTML}{000000}}
+\DeclareOption*{\PackageWarning{rorlink}{Unknown option -- \CurrentOption --}}
\ProcessOptions\relax
+% \end{macrocode}
+%% Load tikz library for processing svg-paths.
+% \begin{macrocode}
\usetikzlibrary{svg.path}
-\definecolor{rorlogocol}{HTML}{53BAA1}
% \end{macrocode}
-%% 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}
% \begin{macrocode}
\tikzset{
rorlogo/.pic={
@@ -136,25 +162,42 @@
}
% \end{macrocode}
%
-% \begin{macro}{\@OrigHeightRecipROR}
+%
%% The original height of the svg file is 119.27pt. The macro here uses 1/119.27 as unit.
% \begin{macrocode}
\newcommand{\@OrigHeightRecipROR}{0.008384338}
% \end{macrocode}
-% \end{macro}
+%
%
-%% 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.
% \begin{macrocode}
\newlength{\@curXheightROR}
-\DeclareRobustCommand\rorlink[1]{%
-\texorpdfstring{%
-\setlength{\@curXheightROR}{\fontcharht\font`X}%
-\href{#1}{\XeTeXLinkBox{\mbox{%
-\begin{tikzpicture}[yscale=-\@OrigHeightRecipROR*\@curXheightROR,
-xscale=\@OrigHeightRecipROR*\@curXheightROR,transform shape]
-\pic{rorlogo};
-\end{tikzpicture}%
-}}}}{}}
+\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{#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}
%
diff --git a/macros/latex/contrib/rorlink/rorlink.ins b/macros/latex/contrib/rorlink/rorlink.ins
index dab31c558e..bb08b231c7 100644
--- a/macros/latex/contrib/rorlink/rorlink.ins
+++ b/macros/latex/contrib/rorlink/rorlink.ins
@@ -1,7 +1,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
@@ -28,7 +28,7 @@ This is a generated file.
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
diff --git a/macros/latex/contrib/rorlink/rorlink.pdf b/macros/latex/contrib/rorlink/rorlink.pdf
index 072caf63bb..9b9aa8d60a 100644
--- a/macros/latex/contrib/rorlink/rorlink.pdf
+++ b/macros/latex/contrib/rorlink/rorlink.pdf
Binary files differ