(My) problem with percent sign in URLs
Hi all, I came across the problem with typesetting long URLs containing special characters transformed to hexadecimal form. Hyphenation of URLs is needed. Minimal examples (URL taken from our garden and adopted): 1. \hyphenatedurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\%20hpw} 2. \hyphenatedurl[]{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\%20hpw} Ad 1: Hyphenation of the URL is OK, but the output contains percent sign preceded by escaping backslash. Ad 2: Percent sign is not escaped but hyphenation of the URL does not operate. I hoped that there could be any option for this purpose but it seems not, brackets are printed out, too. Thank in advance for the help and best regards, Tomas
On 08/14/2017 06:27 PM, Tomas Hala wrote:
Hi all,
I came across the problem with typesetting long URLs containing special characters transformed to hexadecimal form. Hyphenation of URLs is needed.
Minimal examples (URL taken from our garden and adopted):
1. \hyphenatedurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\%20hpw}
Hi Tomas, I think \letterpercent is what you need. Inside a little more complex sample: \setupinteraction[state=start] \unexpanded\def\mypersonalurl#1{% \bgroup\tt\goto{\hyphenatedurl{#1}}[url(#1)]\egroup} \starttext \hsize\zeropoint \mypersonalurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\letterpercent20hpw} \stoptext Please update the garden (another command is \letterhash), when the reply solved your problem. Many thanks (for the update ;-)), Pablo -- http://www.ousia.tk
Hi Pablo (and all), thank you for the solution, it is exactly what I need. It will be an honour for me to update the wiki but I guess I had no permissions. Could somebody give access to me? Tomas Mon, Aug 14, 2017 ve 09:52:20PM +0200 Pablo Rodriguez napsal(a): # On 08/14/2017 06:27 PM, Tomas Hala wrote: # > Hi all, # > # > I came across the problem with typesetting long URLs containing special # > characters transformed to hexadecimal form. Hyphenation of URLs is needed. # > # > Minimal examples (URL taken from our garden and adopted): # > # > 1. \hyphenatedurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\%20hpw} # # Hi Tomas, # # I think \letterpercent is what you need. # # Inside a little more complex sample: # # \setupinteraction[state=start] # \unexpanded\def\mypersonalurl#1{% # \bgroup\tt\goto{\hyphenatedurl{#1}}[url(#1)]\egroup} # \starttext # \hsize\zeropoint # # \mypersonalurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\letterpercent20hpw} # \stoptext # # Please update the garden (another command is \letterhash), when the # reply solved your problem. # # Many thanks (for the update ;-)), # # Pablo # -- # http://www.ousia.tk # ___________________________________________________________________________________ # 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://context.aanhet.net # archive : https://bitbucket.org/phg/context-mirror/commits/ # wiki : http://contextgarden.net # ___________________________________________________________________________________ Tomáš Hála -------------------------------------------------------------------- Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky Zemědělská 1, CZ-613 00 Brno, tel. +420 545 13 22 28 -------------------------------------------------------------------- http://akela.mendelu.cz/~thala
It will be an honour for me to update the wiki but I guess I had no permissions. Could somebody give access to me?
No permissions are needed. You can simply create a new account and edit any page. http://wiki.contextgarden.net/index.php?title=Special:UserLogin&type=signup Aditya
Thanks, very simple, indeed. Tomas Tue, Aug 15, 2017 ve 04:36:15AM -0400 Aditya Mahajan napsal(a): # >It will be an honour for me to update the wiki but I guess I had # >no permissions. Could somebody give access to me? # # No permissions are needed. You can simply create a new account and # edit any page. # # http://wiki.contextgarden.net/index.php?title=Special:UserLogin&type=signup # # Aditya # ___________________________________________________________________________________ # 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://context.aanhet.net # archive : https://bitbucket.org/phg/context-mirror/commits/ # wiki : http://contextgarden.net # ___________________________________________________________________________________ Tomáš Hála -------------------------------------------------------------------- Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky Zemědělská 1, CZ-613 00 Brno, tel. +420 545 13 22 28 -------------------------------------------------------------------- http://akela.mendelu.cz/~thala
Hi, I updated the page about URLs. Reading the text, I found the following sentence which -- in my opinion -- does not correspond with the current behaviour: "You can use \url[aurl] as well, which behaves like \from[#1]." I tried it but the \url[aurl] is not printed out in green colour as well as other similar links and, moreover, it seems not to be clickable. Could somebody confirm or disprove it? # \mypersonalurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\letterpercent20hpw} # # Please update the garden (another command is \letterhash), when the # reply solved your problem. Are there some other predefined "\letterxxx" commands? Is (and how) possible to change the name of page from Url to URL? Cheers, Tomas # Many thanks (for the update ;-)), # # Pablo
Tomas Hala mailto:tomas.hala@mendelu.cz 15. August 2017 um 18:52 Hi,
I updated the page about URLs. Reading the text, I found the following sentence which -- in my opinion -- does not correspond with the current behaviour:
"You can use \url[aurl] as well, which behaves like \from[#1]."
I tried it but the \url[aurl] is not printed out in green colour as well as other similar links and, moreover, it seems not to be clickable. Could somebody confirm or disprove it?
# \mypersonalurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\letterpercent20hpw} # # Please update the garden (another command is \letterhash), when the # reply solved your problem.
Are there some other predefined "\letterxxx" commands? \letteropenbrace \letterclosebrace \letterampersand \letterless \lettermore \letterhash \letterdoublequote \lettersinglequote \letterdollar \letterpercent \letterhat \letterunderscore \letterbar \lettertilde \letterbackslash \letterslash \letterquestionmark \letterat \lettercolon \letterescape \letterbgroup \letteregroup \letterleftbrace \letterrightbrace \letterexclamationmark
Is (and how) possible to change the name of page from Url to URL? I moved the page.
Wolfgang
Is there not some way to "protect" a literal string to be taken
verbatim where no character be active, for it is messy to have to
"clean-up" data such as a url.
Alan
On Tue, 15 Aug 2017 19:07:54 +0200
Wolfgang Schuster
Are there some other predefined "\letterxxx" commands? \letteropenbrace \letterclosebrace \letterampersand \letterless \lettermore \letterhash \letterdoublequote \lettersinglequote \letterdollar \letterpercent \letterhat \letterunderscore \letterbar \lettertilde \letterbackslash \letterslash \letterquestionmark \letterat \lettercolon \letterescape \letterbgroup \letteregroup \letterleftbrace \letterrightbrace \letterexclamationmark
On 08/15/2017 08:28 PM, Alan Braslau wrote:
Is there not some way to "protect" a literal string to be taken verbatim where no character be active, for it is messy to have to "clean-up" data such as a url.
Hi Alan, wrapping the URL (or the footnote that contains it, it will crash inside the footnote) with \startasciimode...\stopasciimode works too: \setupinteraction[state=start] \unexpanded\def\mypersonalurl#1{% \bgroup\tt\goto{\hyphenatedurl{#1}}[url(#1)]\egroup} \starttext \startasciimode \footnote{\mypersonalurl{http://a.b?hpw%20h#pw}} \stopasciimode \stoptext Thomas, my apologies, because I have just remembered this. (I use ConTeXt mainly with XML input sources.) Just in case it helps, Pablo -- http://www.ousia.tk
On 08/15/2017 07:07 PM, Wolfgang Schuster wrote:
Tomas Hala 15. August 2017 um 18:52: [...] Are there some other predefined "\letterxxx" commands? \letteropenbrace [...] \letterexclamationmark
I would add other four (with Wolfgang’s permission): \letterleftparenthesis \letterrightparenthesis \letterleftbracket \letterrightbracket Pablo -- http://www.ousia.tk
# I would add other four (with Wolfgang’s permission): # # \letterleftparenthesis # \letterrightparenthesis # \letterleftbracket # \letterrightbracket Unfortunately, these four commands are not available on my computer (I use TL 2015). Tomas # Pablo # -- # http://www.ousia.tk # ___________________________________________________________________________________ # 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://context.aanhet.net # archive : https://bitbucket.org/phg/context-mirror/commits/ # wiki : http://contextgarden.net # ___________________________________________________________________________________ Tomáš Hála -------------------------------------------------------------------- Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky Zemědělská 1, CZ-613 00 Brno, tel. +420 545 13 22 28 -------------------------------------------------------------------- http://akela.mendelu.cz/~thala
participants (5)
-
Aditya Mahajan
-
Alan Braslau
-
Pablo Rodriguez
-
Tomas Hala
-
Wolfgang Schuster