ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* url: Add macros to the ConTeXt core
@ 2011-11-13 18:38 Paul Menzel
  2011-11-14  9:42 ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2011-11-13 18:38 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 960 bytes --]

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

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: url: Add macros to the ConTeXt core
  2011-11-13 18:38 url: Add macros to the ConTeXt core Paul Menzel
@ 2011-11-14  9:42 ` Aditya Mahajan
  2011-11-14 17:41   ` Khaled Hosny
  2011-11-14 19:38   ` mathew
  0 siblings, 2 replies; 4+ messages in thread
From: Aditya Mahajan @ 2011-11-14  9:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1515 bytes --]

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

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: url: Add macros to the ConTeXt core
  2011-11-14  9:42 ` Aditya Mahajan
@ 2011-11-14 17:41   ` Khaled Hosny
  2011-11-14 19:38   ` mathew
  1 sibling, 0 replies; 4+ messages in thread
From: Khaled Hosny @ 2011-11-14 17:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: url: Add macros to the ConTeXt core
  2011-11-14  9:42 ` Aditya Mahajan
  2011-11-14 17:41   ` Khaled Hosny
@ 2011-11-14 19:38   ` mathew
  1 sibling, 0 replies; 4+ messages in thread
From: mathew @ 2011-11-14 19:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 627 bytes --]

On Mon, Nov 14, 2011 at 03:42, Aditya Mahajan <adityam@umich.edu> wrote:

> 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/>

[-- Attachment #1.2: Type: text/html, Size: 1205 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-14 19:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-13 18:38 url: Add macros to the ConTeXt core Paul Menzel
2011-11-14  9:42 ` Aditya Mahajan
2011-11-14 17:41   ` Khaled Hosny
2011-11-14 19:38   ` mathew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).