ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* hyperlinks with special characters
@ 2014-08-29 17:48 Prashanth N Rao
  2014-08-29 19:52 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Prashanth N Rao @ 2014-08-29 17:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

I have already asked this question on Stackexchange. It appears that no one who has seen the question knows an answer. I figure I'll ask here too, just to cover all bases.

I need to link to some online resources in my PDF file. Based on the official documentation, I have written:

> \useURL[dbdk] [http://dbpedia.org/page/The_Dark_Knight_(film)] [] [it's link to DBPedia]
> 
> Lorem ipsum \goto{the LinkedMDB.org entry on The Dark Knight}[url(http://data.linkedmdb.org/page/film/6224)], and \from[dbdk] dolor sit amet.

Note my code for the link to DBpedia: I had to write it in this convoluted way, instead of using my preferred \goto, because the link has the special characters, `(` and `)`. These characters interfered with `url()`. I can't use HTML's URL encoding scheme because the `%`s interfere with TeX. Is there another escape code format in ConTeXt for use within `\goto{...}[url(...)]`?

Using the suggestion by @phg, I tried the following:

> \startasciimode
> Lorem ipsum \goto{the LinkedMDB.org entry on The Dark Knight}[url(http://data.linkedmdb.org/page/film/6224)], and \goto{it's link to DBPedia}[url(http://dbpedia.org/page/The_Dark_Knight_%28film%29)] dolor sit amet.
> \stopasciimode
I still had to use escape codes, `%28` and `%29`, to keep it from interfering with url(). It turns out that DBpedia does not like these codes, and requires the actual characters. Is there another way I put them in `\goto{...}[url(...)]`?

Thanks!
Prash

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 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] 3+ messages in thread

* Re: hyperlinks with special characters
  2014-08-29 17:48 hyperlinks with special characters Prashanth N Rao
@ 2014-08-29 19:52 ` Hans Hagen
  2014-08-29 21:20   ` Prashanth N Rao
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2014-08-29 19:52 UTC (permalink / raw)
  To: ntg-context

On 8/29/2014 7:48 PM, Prashanth N Rao wrote:
> I have already asked this question on Stackexchange. It appears that no one who has seen the question knows an answer. I figure I'll ask here too, just to cover all bases.
>
> I need to link to some online resources in my PDF file. Based on the official documentation, I have written:
>
>> \useURL[dbdk] [http://dbpedia.org/page/The_Dark_Knight_(film)] [] [it's link to DBPedia]
>>
>> Lorem ipsum \goto{the LinkedMDB.org entry on The Dark Knight}[url(http://data.linkedmdb.org/page/film/6224)], and \from[dbdk] dolor sit amet.
>
> Note my code for the link to DBpedia: I had to write it in this convoluted way, instead of using my preferred \goto, because the link has the special characters, `(` and `)`. These characters interfered with `url()`. I can't use HTML's URL encoding scheme because the `%`s interfere with TeX. Is there another escape code format in ConTeXt for use within `\goto{...}[url(...)]`?

Hm, I can support properly nested () and {} but how about not balanced 
... one way out is to support "" and ''

special(operation)
special(operation(whatever))
special(operation{argument,argument{whatever}})
special(operation{argument{whatever}})

special("operation(")
special("operation(whatever")
special(operation{"argument,argument{whatever"})
special(operation{"argument{whatever"})

I'll add that but it needs testing because the ref parser is already 
somewhat complex.

> Using the suggestion by @phg, I tried the following:
>
>> \startasciimode
>> Lorem ipsum \goto{the LinkedMDB.org entry on The Dark Knight}[url(http://data.linkedmdb.org/page/film/6224)], and \goto{it's link to DBPedia}[url(http://dbpedia.org/page/The_Dark_Knight_%28film%29)] dolor sit amet.
>> \stopasciimode
> I still had to use escape codes, `%28` and `%29`, to keep it from interfering with url(). It turns out that DBpedia does not like these codes, and requires the actual characters. Is there another way I put them in `\goto{...}[url(...)]`?

you can use: \letterpercent

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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] 3+ messages in thread

* Re: hyperlinks with special characters
  2014-08-29 19:52 ` Hans Hagen
@ 2014-08-29 21:20   ` Prashanth N Rao
  0 siblings, 0 replies; 3+ messages in thread
From: Prashanth N Rao @ 2014-08-29 21:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


On Friday 29 August 2014 21:52:33 Hans Hagen wrote:
> On 8/29/2014 7:48 PM, Prashanth N Rao wrote:
> > I have already asked this question on Stackexchange. It appears that no one who has seen the question knows an answer. I figure I'll ask here too, just to cover all bases.
> >
> > I need to link to some online resources in my PDF file. Based on the official documentation, I have written:
> >
> >> \useURL[dbdk] [http://dbpedia.org/page/The_Dark_Knight_(film)] [] [it's link to DBPedia]
> >>
> >> Lorem ipsum \goto{the LinkedMDB.org entry on The Dark Knight}[url(http://data.linkedmdb.org/page/film/6224)], and \from[dbdk] dolor sit amet.
> >
> > Note my code for the link to DBpedia: I had to write it in this convoluted way, instead of using my preferred \goto, because the link has the special characters, `(` and `)`. These characters interfered with `url()`. I can't use HTML's URL encoding scheme because the `%`s interfere with TeX. Is there another escape code format in ConTeXt for use within `\goto{...}[url(...)]`?
> 
> Hm, I can support properly nested () and {} but how about not balanced 
> ... one way out is to support "" and ''
> 
> special(operation)
> special(operation(whatever))
> special(operation{argument,argument{whatever}})
> special(operation{argument{whatever}})
> 
> special("operation(")
> special("operation(whatever")
> special(operation{"argument,argument{whatever"})
> special(operation{"argument{whatever"})
> 
> I'll add that but it needs testing because the ref parser is already 
> somewhat complex.
> 

If I may make a suggestion, you could just support one escape character -> \
That way, balanced or unbalanced, they just have to know one convention. If I
understood your examples correctly, i.e. these are the strings one would write
within url(), this is how they could do it:

special\(operation\)
special\(operation\(whatever\)\)
special\(operation{argument,argument{whatever}}\)
special\(operation{argument{whatever}}\)

special\(operation\(\)
special\(operation\(whatever\)
special\(operation{argument,argument{whatever}\)
special\(operation{"argument{whatever"}\)

And if they ever need a literal \ in their URL, they would have to write \\
In my examples above, I have escaped only ( and ) because they interefere
with url(). If the any other character interferes with your code, they could
escape it as I have shown.


> > Using the suggestion by @phg, I tried the following:
> >
> >> \startasciimode
> >> Lorem ipsum \goto{the LinkedMDB.org entry on The Dark Knight}[url(http://data.linkedmdb.org/page/film/6224)], and \goto{it's link to DBPedia}[url(http://dbpedia.org/page/The_Dark_Knight_%28film%29)] dolor sit amet.
> >> \stopasciimode
> > I still had to use escape codes, `%28` and `%29`, to keep it from interfering with url(). It turns out that DBpedia does not like these codes, and requires the actual characters. Is there another way I put them in `\goto{...}[url(...)]`?
> 
> you can use: \letterpercent
> 
> -----------------------------------------------------------------
>                                            Hans Hagen | PRAGMA ADE
>                Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                               | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 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] 3+ messages in thread

end of thread, other threads:[~2014-08-29 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-29 17:48 hyperlinks with special characters Prashanth N Rao
2014-08-29 19:52 ` Hans Hagen
2014-08-29 21:20   ` Prashanth N Rao

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).