% - 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:
%
% - 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,