%% file: URL.txs (TeXsis version 2.18) % @(#) $Id: Revision: 1.4 Date: 1997/12/18 18:54:27 Author: myers $ %======================================================================* % HyperTeXt support via \special HTML: % \html{} simply stuffs the ``stuff'' into an HTML speical % \linkto{}{} makes a link to a target created with \linkname % \linkname{}{} makes a NAME= target for the given text % \href{URL}{text} links the given text to the URL (as per LANL example) % \URL{URL} links to the given URL and puts it in the text % This stuff is still 'beta' until I get the hyphenation of URL's % working properly. It will then probably be incorporated into % TXStags.tex, but until then here it is by itself. % % Eric Myers % Department of Physics, University of Michigan, Ann Arbor %======================================================================* \ATunlock \newif\ifhtml \htmlfalse % default is HTML OFF! % These just turn off special characters that might be in link names % or URL's, and then invoke @hidden macros to do the real work (below). \def\html{\begingroup\htmlChar\@html} \def\linkto{\begingroup\htmlChar\@linkto} \def\linkname{\begingroup\htmlChar\@linkname} \def\href{\begingroup\htmlChar\@href} \def\URL{\begingroup\htmlChar\@URL} \def\xxxcite{\begingroup\htmlChar\@xxxcite} % Hyperlink NAMES or URL's may contain characters which are special to % TeX, so \htmlChar turns off their special meaning while we read % in the link or URL. Then we end the group so that special characters % CAN be used in the text portion of the link. \def\notie{\def~{\Tilde}} \def\urlChar{% \def\/{\discretionary{/}{}{/}}% \def\.{\discretionary{.}{}{.}}% } \def\@htmlChar{\def\/{/}} \begingroup \catcode`\~=12 \catcode`"=12 \catcode`\/=12 \catcode`<=12 \catcode`>=12 \catcode`\.=12 \begingroup \catcode`\%=12 \catcode`\#=12 \gdef\htmlChar{\notie \catcode`@=12 \catcode`"=12 \catcode``=12 \catcode`'=12 \catcode`[=12 \catcode`]=12 \catcode`(=12 \catcode`)=12 \catcode`<=12 \catcode`>=12 \catcode`_=12 \catcode`^=12 \catcode`$=12 \catcode`\&=12 \catcode`\#=12 \catcode`%=12 \catcode`~=12 \catcode`/=12 \catcode`/=12 \catcode`.=12 \@htmlChar} \gdef\hash{#}\gdef\Tilde{~} \endgroup % Use this to insert general HTML into your document: \gdef\@html#1{\ifhtml\special{html:#1}\fi\endgroup}% % Use this for Local Links (within a document) \gdef\@linkto#1{\endgroup\@@linkto{#1}}% Arg #2 is whatever follows \gdef\@@linkto#1#2{\html{}{#2}\html{}} \gdef\@linkname#1{\endgroup\@@linkname{#1}} \gdef\@@linkname#1#2{\html{}{#2}\html{}} % General Links (any URL): \gdef\@href#1{\endgroup\@@href{#1}}% Arg #2 is whatever follows \gdef\@@href#1#2{\html{}\urlChar{#2}\html{}}% \gdef\@URL#1{\html{}\urlChar{\tt #1}\html{}\endgroup}% \gdef\@xxxcite#1{\href{http://xxx.lanl.gov/abs/#1}% \urlChar{#1}\endgroup} \endgroup % synonyms for macros in hyperbasics.tex \let\hypertarget=\linkname \let\hname=\linkname \ATlock