On Sun, 13 Nov 2011, Paul Menzel wrote:
looking into typesetting URLs I find typesetting URLs quite cumbersome.
Maybe I have not used that feature that often so I am not seeing the advantage to first define a URL somewhere and give it a name
\useURL[aurl] [http://xkcd.com/149/] [] [I prefer hot dogs.]
and then later use it.
\url[aurl]
You just showed below why this is useful, by first using the urls ...
The proposed macros(?) in the section »Tipps and Tricks« [2] [snip]
and then defining them.
[1] http://wiki.contextgarden.net/url [2] http://wiki.contextgarden.net/url#Tipps_and_Tricks
ConTeXt is just doing the reverse: first define the urls and then use them :) I support having commands which typeset the urls directly, but the macros on the wiki are not the best ones.
\def\href#1#2{\useURL[#2][{#2}][][{#1}]\goto{\url[#2]}[url(#1)]}
Why not simply: \def\href#1#2{\goto{#2}[url(#1)]} Or did I miss something?
\def\ahref#1{\color[linkcolor]{\ttx \href{#1}{<#1>}}} \def\fullahref#1{\color[linkcolor]{\ttx \href{#1}{http://#1}}}
These could be easily wrapped around using \useURL and \url (perhaps by adding left and right keys to \setupurl) but \url does not create a hyperlink: http://archive.contextgarden.net/message/20110915.115247.f23c2aad.en.html
\def\mailto#1{\useURL[#1][mailto:#1][][#1]\from[{#1}]} \def\MailTo#1#2{\useURL[#1][mailto:#1][][#2]\from[{#1}]}
Aditya