]> mj.ucw.cz Git - ucwmac.git/commitdiff
ucw-link: Added \urlhack
authorMartin Mares <mj@ucw.cz>
Tue, 20 Aug 2019 19:40:12 +0000 (21:40 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 20 Aug 2019 19:41:00 +0000 (21:41 +0200)
ucw-link.tex

index 0eef8f84383b7a5f9b0f68524ad214629540e984..79594ced38f25be36d530be464b111fe6e52b5b2 100644 (file)
@@ -48,7 +48,8 @@
 %   - 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 +63,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.
 
 \def\urlquestion{?\penalty100\relax}
 \def\urlamp{\&\penalty100\relax}
 \def\urlequal{=\penalty100\relax}
+\def\urlhack#1{#1}
 
 % Kern to place between "//" in an URL
 \newdimen\urlinterslashkern
        \def\%{D}%
        \def\#{E}%
        \def\\{}%
+       \def\urlhack##1{}%
 }}}
 
 % Typeset the URL stored in \tmpb. In most cases, this is used internally by \url,