summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ximera/src/link.dtx
blob: 9e76659e830c964a911be03a75138503da7824f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% Hyperlinks to outside documents
%    \begin{macrocode}
%<*classXimera>
\newcommand*{\link}[2][]{#1%
	\ifthenelse{\equal{#1}{}}%
		{\footnote{Link: \url{#2}}}%
		{\footnote{See #1 at \url{#2}}}
	}
%</classXimera>
%    \end{macrocode}


%    \begin{macrocode}
%<*htXimera>
% This is a command used in versions of documents created with
% these classes; in Jim's opinion it should be deprecated for |\href|
% Bart on the other hand likes |\link|
\renewcommand*{\link}[2][]{%
\ifthenelse{\equal{#1}{}}%
{\url{#2}}
{\href{#2}{#1}}}
%\renewcommand*{\link}[2][]{%
%\ifthenelse{\equal{#1}{}}%
%{\url{#2}}
%{\href{#2}{#1}}}

% because hyperref redefines stuff atbegindocument, we do too.
\AtBeginDocument{\renewcommand{\ref}[1]{\HCode{<a class="reference" href="\##1">#1</a>}}}

%</htXimera>
%    \end{macrocode}