summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ximera/src/link.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/ximera/src/link.dtx')
-rw-r--r--macros/latex/contrib/ximera/src/link.dtx31
1 files changed, 31 insertions, 0 deletions
diff --git a/macros/latex/contrib/ximera/src/link.dtx b/macros/latex/contrib/ximera/src/link.dtx
new file mode 100644
index 0000000000..9e76659e83
--- /dev/null
+++ b/macros/latex/contrib/ximera/src/link.dtx
@@ -0,0 +1,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}