diff options
Diffstat (limited to 'macros/optex/base/hyperlinks.opm')
-rw-r--r-- | macros/optex/base/hyperlinks.opm | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/macros/optex/base/hyperlinks.opm b/macros/optex/base/hyperlinks.opm index ef205f3aa2..4c2007cddb 100644 --- a/macros/optex/base/hyperlinks.opm +++ b/macros/optex/base/hyperlinks.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \ulink {Hyperlinks <2021-05-14>} % preloaded in format +\_codedecl \ulink {Hyperlinks <2021-08-31>} % preloaded in format \_doc ---------------------------- \`\dest``[<type>:<spec>]` creates a destination of internal links. The @@ -27,19 +27,19 @@ \_doc ---------------------------- Each hyperlink is created internally by \`\_xlink``{<type>}{<spec>}{<color>}{<text>}`. This macro expands to `\_quitvmode{<text>}` by default, i.e.\ no active - hyperlink is created, only <text> is printed in horizontal mode. - If \^`\hyperlinks` is used, then `\_xlink` gets meaning of - \`\_xlinkactive` and hyperlinks are created using `\pdfstartlink`, + hyperlink is created, only <text> is printed in horizontal mode (and in a group). + If \^`\hyperlinks` is used, then `\_xlink` gets the meaning of + \`\_xlinkactive` and hyperlinks are created by the `\pdfstartlink`/% `\pdfendlink` primitives. The <text> has given <color> only when - hyperlink is created. But if `\_<type>linkcolor` is defined, it has - precedence. + hyperlink is created. If `\_<type>linkcolor` is defined, it has + precedence over <color>. \nl The \`\_linkdimens` macro declares the dimensions of link area. \nl A specific action can be defined for each link <type> by the macro `\_<type>action{<spec>}`. \OpTeX/ defines only \`\_urlaction``{<url>}`. The default link action (when `\_<type>action` is not defined) is - `goto mame{<type>:<spec>}` (creates an internal link). It is declared in the + `goto name{<type>:<spec>}` (an internal link). It is declared in the \`\_linkactions``{<type>}{<spec>}` macro. \nl The `\_pdfstartlink` primitive uses `attr{\_pdfborder{<type>}}`. The @@ -91,14 +91,15 @@ \_public \ilink \ulink \link ; \_doc ---------------------------- - \`\hyperlinks``{<ilink_color>}{<ulink_color>}` activates `\dest`, `\xlink`, - in order they create links. + \`\hyperlinks``<ilink color><ulink color>` activates `\dest`, `\xlink`, + so that they create links. Not setting colors (`\hyperlinks{}{}`) is also + supported. \_cod ---------------------------- \_def\_hyperlinks#1#2{% \_let\_dest=\_destactive \_let\_xlink=\_xlinkactive - \_let\_ilinkcolor=#1% - \_let\_elinkcolor=#2% + \_let\_ilinkcolor=#1\_empty + \_let\_elinkcolor=#2\_empty \_public \dest \xlink ;% } \_public \hyperlinks ; @@ -201,6 +202,7 @@ Another example `\def\_tocborder{1 0 0}` causes red frames in TOC \_endinput +2021-08-31 \hyperlinks{}{} allowed, bug fixed 2021-05-14 \_xlink introduced, \link, \ilink, \ulink re-implemented. 2021-05-12 \url: triplet :// instead //, \_urlslashslash removed. 2021-05-11 \url reimplemented, \_urlxskip added. |