summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-03-16 22:06:25 +0000
committerKarl Berry <karl@freefriends.org>2021-03-16 22:06:25 +0000
commitf2effa23ac78e40a3add9f09b6a9bce843941ce3 (patch)
tree3d360f607240118d492cc1ad08b410713478d4cb /Master
parentc8201b3e2e25ed926de8a2f47e5d11fce62dc9b5 (diff)
orcidlink (16mar21)
git-svn-id: svn://tug.org/texlive/trunk@58432 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/orcidlink/README.md3
-rw-r--r--Master/texmf-dist/doc/latex/orcidlink/orcidlink.pdfbin135025 -> 164719 bytes
-rw-r--r--Master/texmf-dist/doc/latex/orcidlink/preview.pngbin27457 -> 0 bytes
-rw-r--r--Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx44
-rw-r--r--Master/texmf-dist/tex/latex/orcidlink/orcidlink.sty22
5 files changed, 44 insertions, 25 deletions
diff --git a/Master/texmf-dist/doc/latex/orcidlink/README.md b/Master/texmf-dist/doc/latex/orcidlink/README.md
index 79e1e82c3d9..6b0100438a6 100644
--- a/Master/texmf-dist/doc/latex/orcidlink/README.md
+++ b/Master/texmf-dist/doc/latex/orcidlink/README.md
@@ -1,7 +1,7 @@
# orcidlink-LaTeX-command
LaTeX style file to add a macro for inserting a linked ORCiD logo
-This LaTeX style file just defines a single macro, `\orcidlink`. The code is from [this TeX.SE answer](https://tex.stackexchange.com/a/445583/34063). My only contribution was wrapping it into a style file.
+This LaTeX style file just defines a single macro, `\orcidlink`. The code is from [this TeX.SE answer](https://tex.stackexchange.com/a/445583/34063). My contribution was wrapping it into a style file (and improving the fragility of the command a bit).
Installation
------------
@@ -35,7 +35,6 @@ Dependancies
This package relies on the following packages:
- [hyperref](https://www.ctan.org/pkg/hyperref)
-- [scalerel](https://www.ctan.org/pkg/scalerel)
- [tikz](https://www.ctan.org/pkg/pgf)
All of these packages are included in the popular [TeX Live](https://www.tug.org/texlive/) distribution, so most users should not have to install anything new.
diff --git a/Master/texmf-dist/doc/latex/orcidlink/orcidlink.pdf b/Master/texmf-dist/doc/latex/orcidlink/orcidlink.pdf
index 160e90aead6..b064dbf5619 100644
--- a/Master/texmf-dist/doc/latex/orcidlink/orcidlink.pdf
+++ b/Master/texmf-dist/doc/latex/orcidlink/orcidlink.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/orcidlink/preview.png b/Master/texmf-dist/doc/latex/orcidlink/preview.png
deleted file mode 100644
index cbe1add8883..00000000000
--- a/Master/texmf-dist/doc/latex/orcidlink/preview.png
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx b/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx
index 016d225d0c4..7f34baa2fce 100644
--- a/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx
+++ b/Master/texmf-dist/source/latex/orcidlink/orcidlink.dtx
@@ -27,7 +27,7 @@
%<*driver>
\documentclass{ltxdoc}
\usepackage[dvipsnames]{xcolor}
-\usepackage{orcidlink}[2020/11/21]
+\usepackage{orcidlink}[2021/03/15]
\hypersetup{colorlinks,urlcolor=NavyBlue,citecolor=NavyBlue,linkcolor=NavyBlue,pdfusetitle}
\usepackage{graphicx}
\EnableCrossrefs
@@ -40,7 +40,7 @@
%</driver>
% \fi
%
-% \CheckSum{22}
+% \CheckSum{32}
%
% \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
@@ -63,6 +63,8 @@
% \changes{v1.0.1}{2020/11/21}{Bugfix due to misunderstanding of docstrip}
% \changes{v1.0.2}{2020/11/21}{Fix fragility of command when inside of
% author, and combined with hyperref's option pdfusetitle}
+% \changes{v1.0.3}{2021/03/15}{Improve fragility by calculating
+% scaling ourselves, and using DeclareRobustCommand}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
@@ -84,15 +86,13 @@
% \section{Usage}
%
% To use this package, in the preamble include
-% \begin{macrocode}
+% \begin{verbatim}
% \usepackage{orcidlink}
-% \end{macrocode}
+% \end{verbatim}
%
-% \DescribeMacro{\orcidlink}
+% \DescribeMacro{\orcidlink\marg{orcid}}
% Insert the ORCiD logo (\orcidlink{}), which is hyperlinked to the URL
-% of the researcher whose iD was specified. Usage:
-%
-% |\orcidlink| \marg{orcid}\newline
+% of the researcher whose iD was specified.
% Replace the mandatory argument \meta{orcid} with your
% ORCiD --- just the digits, not your whole URL.
% For example, the command
@@ -101,9 +101,9 @@
% This is most common in
% the author list. For example, in the preamble of a RevTeX article,
% if you write
-% \begin{macrocode}
+% \begin{verbatim}
% \author{Emmy Noether\,\orcidlink{0000-0000-0000-0000}}
-% \end{macrocode}
+% \end{verbatim}
% then the article byline will look something like this:
%
% \includegraphics[width=0.5\textwidth]{preview}\newline{}
@@ -120,12 +120,11 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{orcidlink}
- [2020/11/21 v1.0.2 Linked ORCiD logo macro package]
+ [2021/03/15 v1.0.3 Linked ORCiD logo macro package]
%% All I did was package up Milo's code on TeX.SE,
%% see https://tex.stackexchange.com/a/445583/34063
\RequirePackage{hyperref}
-\RequirePackage{scalerel}
\RequirePackage{tikz}
\ProcessOptions\relax
@@ -141,16 +140,27 @@
svg{M88.7,56.8c0,5.5-4.5,10.1-10.1,10.1c-5.6,0-10.1-4.6-10.1-10.1c0-5.6,4.5-10.1,10.1-10.1C84.2,46.7,88.7,51.3,88.7,56.8z};
}
}
+
+%% Reciprocal of the height of the svg whose source is above. The
+%% original generates a 256pt high graphic; this macro holds 1/256.
+\newcommand{\@OrigHeightRecip}{0.00390625}
+
+%% We will compute the current X height to make the logo the right height
+\newlength{\@curXheight}
+
% \end{macrocode}
%
% \begin{macro}{\orcidlink}
% \begin{macrocode}
-
-\newcommand\orcidlink[1]{\texorpdfstring{\href{https://orcid.org/#1}{\mbox{\scalerel*{
-\begin{tikzpicture}[yscale=-1,transform shape]
+\DeclareRobustCommand\orcidlink[1]{%
+\texorpdfstring{%
+\setlength{\@curXheight}{\fontcharht\font`X}%
+\href{https://orcid.org/#1}{\mbox{%
+\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight,
+xscale=\@OrigHeightRecip*\@curXheight,transform shape]
\pic{orcidlogo};
-\end{tikzpicture}
-}{|}}}}{}}
+\end{tikzpicture}%
+}}}{}}
\endinput
% \end{macrocode}
diff --git a/Master/texmf-dist/tex/latex/orcidlink/orcidlink.sty b/Master/texmf-dist/tex/latex/orcidlink/orcidlink.sty
index 20f8c86b1d2..15b7242306f 100644
--- a/Master/texmf-dist/tex/latex/orcidlink/orcidlink.sty
+++ b/Master/texmf-dist/tex/latex/orcidlink/orcidlink.sty
@@ -20,12 +20,11 @@
%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{orcidlink}
- [2020/11/21 v1.0.2 Linked ORCiD logo macro package]
+ [2021/03/15 v1.0.3 Linked ORCiD logo macro package]
%% All I did was package up Milo's code on TeX.SE,
%% see https://tex.stackexchange.com/a/445583/34063
\RequirePackage{hyperref}
-\RequirePackage{scalerel}
\RequirePackage{tikz}
\ProcessOptions\relax
@@ -42,11 +41,22 @@
}
}
-\newcommand\orcidlink[1]{\texorpdfstring{\href{https://orcid.org/#1}{\mbox{\scalerel*{
-\begin{tikzpicture}[yscale=-1,transform shape]
+%% Reciprocal of the height of the svg whose source is above. The
+%% original generates a 256pt high graphic; this macro holds 1/256.
+\newcommand{\@OrigHeightRecip}{0.00390625}
+
+%% We will compute the current X height to make the logo the right height
+\newlength{\@curXheight}
+
+\DeclareRobustCommand\orcidlink[1]{%
+\texorpdfstring{%
+\setlength{\@curXheight}{\fontcharht\font`X}%
+\href{https://orcid.org/#1}{\mbox{%
+\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight,
+xscale=\@OrigHeightRecip*\@curXheight,transform shape]
\pic{orcidlogo};
-\end{tikzpicture}
-}{|}}}}{}}
+\end{tikzpicture}%
+}}}{}}
\endinput
%%