]> mj.ucw.cz Git - ucwmac.git/blobdiff - ucw-link.tex
Released as version 2.0 with no functional changes
[ucwmac.git] / ucw-link.tex
index 0eef8f84383b7a5f9b0f68524ad214629540e984..ef229c483653a1e183a890f7aef8e2b5418c5998 100644 (file)
 %
 %   - They can contain various characters considered special by TeX.
 %   - We want to adjust appearance of "//", "_", "~" according to font.
+%   - "--" should not produce a ligature.
 %   - We want to insert a breakpoint after "/", "?", "&".
 %   - We need the raw form of the URL for PDF links.
 %   - We cannot rely purely on changing catcodes, as we sometimes need
 %     to parse URLs given as arguments of macros.
-%   - Sometimes, it is useful to insert a manual line break to the URL.
+%   - Sometimes, it is useful to insert a manual line break or another
+%     typesetting hack to the URL.
 %
 % Therefore:
 %
@@ -62,6 +64,8 @@
 %   - When typesetting the URL, the auxiliary macros expand differently.
 %     Furthermore, they can be temporarily re-defined in the \urlprefix macro.
 %   - "\\" (which is usually called to produce a line break) disappears in PDF links.
+%   - If you use \urlhack{X} in the URL, it is typeset as X, but it disappears
+%     in PDF links.
 %   - If you call a custom macro in the URL, you can modify its definition
 %     for typesetting in \urlprefix and for PDF links by appending to \urlplainascii.
 
        \replacestrings{?}{\urlquestion}%
        \replacestrings{&}{\urlamp}%
        \replacestrings{=}{\urlequal}%
+       \replacestrings{-}{\urlminus}%
 }
 
 % Style switches at the beginning/end of an URL (feel free to re-define them)
 \def\urlquestion{?\penalty100\relax}
 \def\urlamp{\&\penalty100\relax}
 \def\urlequal{=\penalty100\relax}
+\def\urlminus{\hbox{-}}
+\def\urlhack#1{#1}
 
 % Kern to place between "//" in an URL
 \newdimen\urlinterslashkern
        \def\urlquestion{?}%
        \def\urlamp{C}%
        \def\urlequal{=}%
+       \def\urlminus{-}%
        \def\%{D}%
        \def\#{E}%
        \def\\{}%
+       \def\urlhack##1{}%
 }}}
 
 % Typeset the URL stored in \tmpb. In most cases, this is used internally by \url,