]> mj.ucw.cz Git - ucwmac.git/blobdiff - ucw-ref.tex
Released as v2.0.1
[ucwmac.git] / ucw-ref.tex
index 74143e212b2825dd93013bdf0e1307a1ce917a0a..86d41a19c3dc67d14a68ef7dc9c231ec1012e952 100644 (file)
@@ -2,7 +2,8 @@
 % Written by Martin Mares <mj@ucw.cz> in 2018 and placed into public domain
 % -------------------------------------------------------------------------
 
-\input ucw-link.tex
+\ucwdefmodule{ref}
+\ucwmodule{link}
 
 % We maintain a collection of objects. Each object has:
 %    - type (namespace -- e.g., chapter)
@@ -43,7 +44,7 @@
        \ifx\optarg\relax
                \let\currentid\relax
        \else
-               \edef\currentid{#1\optarg}%
+               \edef\currentid{#1:\optarg}%
                \writeid{\currentid}{#2}%
                \destpos{\currentid}%
        \fi
 % A low-level interface for typesetting references: produces a clickable link
 % to the identifier #2 of type #1 with a label translated by macro #3 (use \relax
 % for no translation).
-\def\reflink#1#2#3{\expandafter\ifx\csname id:#1#2\endcsname\relax
+\def\reflink#1#2#3{\expandafter\ifx\csname id:#1:#2\endcsname\relax
        {\ifx\bo\undefined\bf\else\bo\fi ??}%
-       \immediate\write16{*** Warning: Reference #1 undefined ***}%
+       \immediate\write16{*** Warning: Reference #1:#2 undefined ***}%
 \else
-       \link{#1#2}{#3{\csname id:#1#2\endcsname}}%
+       \link{#1:#2}{#3{\csname id:#1:#2\endcsname}}%
 \fi
 }