Skip to content

Commit

Permalink
Use XeTeXLinkBox to get hyperlink working correctly with XeTeX.
Browse files Browse the repository at this point in the history
Thanks to Tim Henke for the bug report.
  • Loading branch information
duetosymmetry committed Jun 11, 2021
1 parent e75a795 commit 5034833
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions orcidlink.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
%</driver>
% \fi
%
% \CheckSum{32}
% \CheckSum{33}
%
% \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
Expand All @@ -65,6 +65,8 @@
% author, and combined with hyperref's option pdfusetitle}
% \changes{v1.0.3}{2021/03/15}{Improve fragility by calculating
% scaling ourselves, and using DeclareRobustCommand}
% \changes{v1.0.4}{2021/06/11}{Use XeTeXLinkBox to get hyperlink
% working correctly with XeTeX. Thanks to Tim Henke for the bug report.}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
Expand Down Expand Up @@ -120,7 +122,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{orcidlink}
[2021/03/15 v1.0.3 Linked ORCiD logo macro package]
[2021/06/11 v1.0.4 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
Expand Down Expand Up @@ -155,12 +157,12 @@
\DeclareRobustCommand\orcidlink[1]{%
\texorpdfstring{%
\setlength{\@curXheight}{\fontcharht\font`X}%
\href{https://orcid.org/#1}{\mbox{%
\href{https://orcid.org/#1}{\XeTeXLinkBox{\mbox{%
\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight,
xscale=\@OrigHeightRecip*\@curXheight,transform shape]
\pic{orcidlogo};
\end{tikzpicture}%
}}}{}}
}}}}{}}

\endinput
% \end{macrocode}
Expand Down
6 changes: 3 additions & 3 deletions orcidlink.sty
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{orcidlink}
[2021/03/15 v1.0.3 Linked ORCiD logo macro package]
[2021/06/11 v1.0.4 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
Expand Down Expand Up @@ -51,12 +51,12 @@
\DeclareRobustCommand\orcidlink[1]{%
\texorpdfstring{%
\setlength{\@curXheight}{\fontcharht\font`X}%
\href{https://orcid.org/#1}{\mbox{%
\href{https://orcid.org/#1}{\XeTeXLinkBox{\mbox{%
\begin{tikzpicture}[yscale=-\@OrigHeightRecip*\@curXheight,
xscale=\@OrigHeightRecip*\@curXheight,transform shape]
\pic{orcidlogo};
\end{tikzpicture}%
}}}{}}
}}}}{}}

\endinput
%%
Expand Down

0 comments on commit 5034833

Please sign in to comment.