Changes

Jump to navigation Jump to search
1,140 bytes added ,  07:22, 23 July 2023
no edit summary
These special commands can be used in other cases, like {{cmd|useURL}}, too.
 
== Setting Color and Style ==
== Tips and Tricks ==
 
=== Using variable URLs ===
When using variables, or macros in general, it's necessary to consider that <code>\useURL</code> and <code>\from[]</code> '''don't expand''', which means that any commands within will be treated like text and printed plainly, i.e. instead of the hyperlink the command name will be pasted to the browser or mail client. To circumvent this use <code>\expanded{}</code> around <code>\useURL</code>:
 
<texcode>
\expanded{\useURL[][][][]}
</texcode>
 
The following MWE demonstrates the issue.
 
<texcode>
\setupinteraction[state=start]
%
\setvariables[Sender][Mail={ntg-context@ntg.nl}]
%
\useURL[Direct][mailto:ntg-context@ntg.nl][][ntg-context@ntg.nl]
\useURL[Unexpanded][mailto:\getvariable{Sender}{Mail}][][\getvariable{Sender}{Mail}]
% same as above but within \expanded{}:
\expanded{\useURL[Expanded][mailto:\getvariable{Sender}{Mail}][][\getvariable{Sender}{Mail}]}
%
\starttext
\from[Direct] Direct input works\blank
\from[Unexpanded] Unexpanded fails\blank
\from[Expanded] Expanded works\blank
%
In the PDF mind the tooltips and how the wrong line transfers to the mail client.
\stoptext
</texcode>
=== Many Different Hyperrefs ===
194

edits

Navigation menu