Dear ConTeXt folks, 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] The proposed macros(?) in the section »Tipps and Tricks« [2] \def\href#1#2{\useURL[#2][{#2}][][{#1}]\goto{\url[#2]}[url(#1)]} \def\ahref#1{\color[linkcolor]{\ttx \href{#1}{<#1>}}} \def\fullahref#1{\color[linkcolor]{\ttx \href{#1}{http://#1}}} \def\mailto#1{\useURL[#1][mailto:#1][][#1]\from[{#1}]} \def\MailTo#1#2{\useURL[#1][mailto:#1][][#2]\from[{#1}]} seem quite useful. Could they be added to the ConTeXt core(?)? Thanks, Paul [1] http://wiki.contextgarden.net/url [2] http://wiki.contextgarden.net/url#Tipps_and_Tricks
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
On Mon, Nov 14, 2011 at 04:42:54AM -0500, Aditya Mahajan wrote:
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)]}
I use something like that all the time. Regards, Khaled
On Mon, Nov 14, 2011 at 03:42, Aditya Mahajan
Why not simply:
\def\href#1#2{\goto{#2}[url(#**1)]}
Or did I miss something?
I use this: % Define \Site[id][url]{description} to put in a clickable link % with footnoted URL \def\Site[#1][#2]#3{\useURL[#1][#2][][#3]\from[#1]\footnote[#1]{\tt\hyphenatedurl{#2}}} That way people reading PDFs on a computer can click the site name in the text to go there, and not have to see a URL; those with printed copies can look at the footnote at the bottom of the page to find the URL and type it in. mathew -- URL:http://www.pobox.com/~meta/
participants (4)
-
Aditya Mahajan
-
Khaled Hosny
-
mathew
-
Paul Menzel