From cb2ebb0dcd51d46a1056b6aaf47e0315ef3a9de0 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Tue, 20 Aug 2019 21:40:12 +0200 Subject: [PATCH 1/1] ucw-link: Added \urlhack --- ucw-link.tex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ucw-link.tex b/ucw-link.tex index 0eef8f8..79594ce 100644 --- a/ucw-link.tex +++ b/ucw-link.tex @@ -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. @@ -116,6 +119,7 @@ \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 @@ -141,6 +145,7 @@ \def\%{D}% \def\#{E}% \def\\{}% + \def\urlhack##1{}% }}} % Typeset the URL stored in \tmpb. In most cases, this is used internally by \url, -- 2.39.2