-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to latest version of orcidlink
- Loading branch information
1 parent
e936337
commit d6a4bbf
Showing
1 changed file
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
%% | ||
%% This is a generated file. | ||
%% | ||
%% Copyright (C) 2020 by Leo C. Stein <[email protected]> | ||
%% Copyright (C) 2019-2024 by Leo C. Stein <[email protected]> | ||
%% -------------------------------------------------------------------------- | ||
%% This work may be distributed and/or modified under the | ||
%% conditions of the LaTeX Project Public License, either version 1.3 | ||
|
@@ -20,10 +20,11 @@ | |
%% | ||
\NeedsTeXFormat{LaTeX2e}[1994/06/01] | ||
\ProvidesPackage{orcidlink} | ||
[2021/03/15 v1.0.3 Linked ORCiD logo macro package] | ||
[2024/06/26 v1.1.0 Support ORCID's three different ID formats.] | ||
|
||
%% All I did was package up Milo's code on TeX.SE, | ||
%% see https://tex.stackexchange.com/a/445583/34063 | ||
%% This started out as Milo's code on TeX.SE, | ||
%% see https://tex.stackexchange.com/a/445583/34063. | ||
%% It has since been expanded with more commands. | ||
\RequirePackage{hyperref} | ||
\RequirePackage{tikz} | ||
|
||
|
@@ -48,15 +49,29 @@ | |
%% We will compute the current X height to make the logo the right height | ||
\newlength{\@curXheight} | ||
|
||
\DeclareRobustCommand\orcidlink[1]{% | ||
%% Prevent externalization of the ORCiD logo. | ||
\newcommand{\@preventExternalization}{% | ||
\ifcsname tikz@library@external@loaded\endcsname% | ||
\tikzset{external/export next=false}\else\fi% | ||
} | ||
|
||
\newcommand{\orcidlogo}{% | ||
\texorpdfstring{% | ||
\setlength{\@curXheight}{\fontcharht\font`X}% | ||
\href{https://orcid.org/#1}{\mbox{% | ||
\XeTeXLinkBox{% | ||
\@preventExternalization% | ||
\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight, | ||
xscale=\@OrigHeightRecip*\@curXheight,transform shape] | ||
\pic{orcidlogo}; | ||
\end{tikzpicture}% | ||
}}}{}} | ||
}}{}} | ||
|
||
\DeclareRobustCommand\orcidlinkX[3]{\href{https://orcid.org/#2}{% | ||
\ifstrempty{#1}{}{#1\,}\orcidlogo\ifstrempty{#3}{}{\,#3}}} | ||
\newcommand{\orcidlinkf}[1]{\orcidlinkX{}{#1}{https://orcid.org/#1}} | ||
\newcommand{\orcidlinkc}[1]{\orcidlinkX{}{#1}{#1}} | ||
\newcommand{\orcidlinki}[2]{\orcidlinkX{#1}{#2}{}} | ||
\newcommand{\orcidlink}[1]{\orcidlinkX{}{#1}{}} | ||
|
||
\endinput | ||
%% | ||
|