* hyphenated url @ 2010-10-25 8:25 Steffen Wolfrum 2010-10-25 9:16 ` Philipp Gesang ` (2 more replies) 0 siblings, 3 replies; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-25 8:25 UTC (permalink / raw) To: mailing list for ConTeXt users Hi, the "%" is a frequently used character in URL. But \hyphenatedurl{} can deal with it ... Does someone has a fix? \starttext text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. \stoptext Thanks, Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 8:25 hyphenated url Steffen Wolfrum @ 2010-10-25 9:16 ` Philipp Gesang 2010-10-25 9:39 ` Steffen Wolfrum 2010-10-25 10:06 ` Steffen Wolfrum 2010-10-25 17:30 ` Aditya Mahajan 2010-10-31 6:06 ` Aditya Mahajan 2 siblings, 2 replies; 43+ messages in thread From: Philipp Gesang @ 2010-10-25 9:16 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1261 bytes --] On 2010-10-25 <10:25:55>, Steffen Wolfrum wrote: > Hi, > > the "%" is a frequently used character in URL. > But \hyphenatedurl{} can deal with it ... > > Does someone has a fix? > > > \starttext > text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. Ugly, but it works: text\footnote{test \hyphenatedurl{www.test\letterpercent it.com} test.} text. Regards, Philipp PS: As I understand, the percent sign appears mostly in url-encoded strings. Couldn’t you just convert that to unicode and let the browser do the re-encoding when the url is accessed? > \stoptext > > > Thanks, > Steffen > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments [-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 9:16 ` Philipp Gesang @ 2010-10-25 9:39 ` Steffen Wolfrum 2010-10-25 9:50 ` Philipp Gesang 2010-10-25 10:06 ` Steffen Wolfrum 1 sibling, 1 reply; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-25 9:39 UTC (permalink / raw) To: mailing list for ConTeXt users Am 25.10.2010 um 11:16 schrieb Philipp Gesang: > On 2010-10-25 <10:25:55>, Steffen Wolfrum wrote: >> Hi, >> >> the "%" is a frequently used character in URL. >> But \hyphenatedurl{} can deal with it ... >> >> Does someone has a fix? >> >> >> \starttext >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > Ugly, but it works: > > text\footnote{test \hyphenatedurl{www.test\letterpercent it.com} test.} text. If setupinteraction is set [state=start] it does not work: ! Undefined control sequence. \normalhyphenatedurl ...phenatedurlnormal \let \b \dohyphenatedurlbefore \le... \@@ddfootnotetitle ...w.test\letterpercent it.com} test. \dododescriptioncomponent ...onparameter \c!title }}}\endgroup \fi \fi \fi \... \@@notemakedescription ...list =,\c!bookmark =,][] \xdef \currentnotenumber {... l.27 ...durl{www.test\letterpercent it.com} test.} text. ? Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 9:39 ` Steffen Wolfrum @ 2010-10-25 9:50 ` Philipp Gesang 2010-10-25 10:05 ` Steffen Wolfrum 0 siblings, 1 reply; 43+ messages in thread From: Philipp Gesang @ 2010-10-25 9:50 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 2672 bytes --] On 2010-10-25 <11:39:12>, Steffen Wolfrum wrote: > > Am 25.10.2010 um 11:16 schrieb Philipp Gesang: > > > On 2010-10-25 <10:25:55>, Steffen Wolfrum wrote: > >> Hi, > >> > >> the "%" is a frequently used character in URL. > >> But \hyphenatedurl{} can deal with it ... > >> > >> Does someone has a fix? > >> > >> > >> \starttext > >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > > Ugly, but it works: > > > > text\footnote{test \hyphenatedurl{www.test\letterpercent it.com} test.} text. > > > If setupinteraction is set [state=start] it does not work: Did you try exactly this: ··8<····························································· \setupinteraction[state=start] \starttext text\footnote{test \hyphenatedurl{www.test\letterpercent it.com} test.} text. \stoptext ··8<····························································· ? > > > ! Undefined control sequence. > > > \normalhyphenatedurl ...phenatedurlnormal \let \b > \dohyphenatedurlbefore \le... > \@@ddfootnotetitle ...w.test\letterpercent it.com} > test. > \dododescriptioncomponent ...onparameter \c!title > }}}\endgroup \fi \fi \fi \... > \@@notemakedescription ...list =,\c!bookmark =,][] > \xdef \currentnotenumber {... > l.27 ...durl{www.test\letterpercent it.com} test.} > text. > ? Ahh, looks like your ‘\hyphenatedurl’ is not yet unexpanded … how old is your context? With the one from 2010.10.22 16:46 it definitely works. If you don’t want to update, check lang-url.mkiv for ‘\def\hyphenatedurl#1%’ and prefix it with an ‘\unexpanded’. Philipp > > > > Steffen > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments [-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 9:50 ` Philipp Gesang @ 2010-10-25 10:05 ` Steffen Wolfrum 2010-10-25 10:26 ` Philipp Gesang 0 siblings, 1 reply; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-25 10:05 UTC (permalink / raw) To: mailing list for ConTeXt users Am 25.10.2010 um 11:50 schrieb Philipp Gesang: > On 2010-10-25 <11:39:12>, Steffen Wolfrum wrote: >> >> Am 25.10.2010 um 11:16 schrieb Philipp Gesang: >> >>> On 2010-10-25 <10:25:55>, Steffen Wolfrum wrote: >>>> Hi, >>>> >>>> the "%" is a frequently used character in URL. >>>> But \hyphenatedurl{} can deal with it ... >>>> >>>> Does someone has a fix? >>>> >>>> >>>> \starttext >>>> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >>> Ugly, but it works: >>> >>> text\footnote{test \hyphenatedurl{www.test\letterpercent it.com} test.} text. >> >> >> If setupinteraction is set [state=start] it does not work: > > Did you try exactly this: > > ··8<····························································· > \setupinteraction[state=start] > \starttext > text\footnote{test \hyphenatedurl{www.test\letterpercent it.com} test.} text. > \stoptext > ··8<····························································· sorry, in the meanwhile I was experimenting with another hack (but does not work when used in footnotes) that mixed things up: \let\normalhyphenatedurl\hyphenatedurl \bgroup \catcode`\%=11 \gdef\hyphenatedurl {\bgroup \catcode`\%=11 \expandafter\egroup \normalhyphenatedurl} \egroup Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 10:05 ` Steffen Wolfrum @ 2010-10-25 10:26 ` Philipp Gesang 2010-10-25 10:45 ` Steffen Wolfrum 0 siblings, 1 reply; 43+ messages in thread From: Philipp Gesang @ 2010-10-25 10:26 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 992 bytes --] On 2010-10-25 <12:05:37>, Steffen Wolfrum wrote: > > \let\normalhyphenatedurl\hyphenatedurl > > \bgroup > > \catcode`\%=11 > > \gdef\hyphenatedurl \unexpanded\gdef\hyphenatedurl Should work in footnotes. Regards, Philipp > {\bgroup > \catcode`\%=11 > \expandafter\egroup > \normalhyphenatedurl} > > \egroup > > > > Steffen > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments [-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 10:26 ` Philipp Gesang @ 2010-10-25 10:45 ` Steffen Wolfrum 2010-10-25 13:12 ` Philipp Gesang 0 siblings, 1 reply; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-25 10:45 UTC (permalink / raw) To: mailing list for ConTeXt users Am 25.10.2010 um 12:26 schrieb Philipp Gesang: > On 2010-10-25 <12:05:37>, Steffen Wolfrum wrote: >> >> \let\normalhyphenatedurl\hyphenatedurl >> >> \bgroup >> >> \catcode`\%=11 >> >> \gdef\hyphenatedurl > > \unexpanded\gdef\hyphenatedurl > > Should work in footnotes. Regards, Philipp No, it doesn't (see below). Do you have an other idea? Thanks, Steffen (ConTeXt ver: 2010.10.21) Runaway argument? {test \hyphenatedurl {www.test\par \stoptext \par ! File ended while scanning use of \@@notemakedescription. system > error on line 0 in file : File ended while scanning use of \@@notemakedescription ... \let\normalhyphenatedurl\hyphenatedurl \bgroup \catcode`\%=11 \unexpanded\gdef\hyphenatedurl {\bgroup \catcode`\%=11 \expandafter\egroup \normalhyphenatedurl} \egroup \setupinteraction [state=start] \starttext text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. \stoptext ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 10:45 ` Steffen Wolfrum @ 2010-10-25 13:12 ` Philipp Gesang 2010-10-25 15:52 ` Steffen Wolfrum 2010-10-27 20:28 ` Steffen Wolfrum 0 siblings, 2 replies; 43+ messages in thread From: Philipp Gesang @ 2010-10-25 13:12 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 2210 bytes --] On 2010-10-25 <12:45:17>, Steffen Wolfrum wrote: > > Am 25.10.2010 um 12:26 schrieb Philipp Gesang: > > \unexpanded\gdef\hyphenatedurl > > > > Should work in footnotes. Regards, Philipp > > > No, it doesn't (see below). > Do you have an other idea? Right; it works in footnotes but doesn’t accomplish what you want. Sorry, I tried a lot but ‘\letterpercent’ is the only way it works for me. Concerning the urlencoding I referred to browsers automatically converting raw urls, like for instance http://www.google.com/search?q=ähre , which is encoded as http://www.google.com/search?q=%C3%A4hre by my browser. As long as your urls mainly consist of unicode strings you might not need the actual (ascii) percent sign. In this case you could be fine simply by converting strings like ‘%C3%A4hre’ to ‘Ähre’, rendering urls percent-less, and rely on the browsers to re-encode them on the fly. Might be a bit far fetched, though. Philipp > > Thanks, Steffen > (ConTeXt ver: 2010.10.21) > > > Runaway argument? > {test \hyphenatedurl {www.test\par \stoptext \par > ! File ended while scanning use of \@@notemakedescription. > > system > error on line 0 in file : File ended while scanning use of \@@notemakedescription ... > > > \let\normalhyphenatedurl\hyphenatedurl > > \bgroup > > \catcode`\%=11 > > \unexpanded\gdef\hyphenatedurl > {\bgroup > \catcode`\%=11 > \expandafter\egroup > \normalhyphenatedurl} > > \egroup > > \setupinteraction > [state=start] > > \starttext > > text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > > \stoptext > > > > > ___________________________________________________________________________________ > 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: Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 13:12 ` Philipp Gesang @ 2010-10-25 15:52 ` Steffen Wolfrum 2010-10-27 21:30 ` Peter Münster 2010-10-27 20:28 ` Steffen Wolfrum 1 sibling, 1 reply; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-25 15:52 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Hans Hagen Am 25.10.2010 um 15:12 schrieb Philipp Gesang: > Concerning the urlencoding I referred to browsers automatically > converting raw urls, like for instance > > http://www.google.com/search?q=ähre > > , which is encoded as > > http://www.google.com/search?q=%C3%A4hre > > by my browser. As long as your urls mainly consist of unicode > strings you might not need the actual (ascii) percent sign. In > this case you could be fine simply by converting strings like > ‘%C3%A4hre’ to ‘Ähre’, rendering urls percent-less, and rely on > the browsers to re-encode them on the fly. Might be a bit far > fetched, though. It is the space the encodes to %20. Thus, it might look a bit strange eg. in cases like this: http://www.cirp.ru/conferences/new%20neighborhood%20policy/publications/frellesen%20paper.doc There is no way to typeset this in ConTeXt MkIV??? Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 15:52 ` Steffen Wolfrum @ 2010-10-27 21:30 ` Peter Münster 0 siblings, 0 replies; 43+ messages in thread From: Peter Münster @ 2010-10-27 21:30 UTC (permalink / raw) To: mailing list for ConTeXt users On Mon, Oct 25 2010, Steffen Wolfrum wrote: > > http://www.cirp.ru/conferences/new%20neighborhood%20policy/publications/frellesen%20paper.doc > > There is no way to typeset this in ConTeXt MkIV??? No problem here: \setupinteraction[state=start] \starttext No hexa-code after percent, so Acroread transforms \% to \%25\footnote{\hyphenatedurl{www.test.com/\letterpercent/test}} ok\footnote{\hyphenatedurl{www.test.com/\letterpercent24/test}} ok\footnote{\hyphenatedurl{http://www.cirp.ru/conferences/new\letterpercent 20neighborhood\letterpercent20policy/publications/frellesen\letterpercent 20paper.doc}} Does not work, perhaps bug in \ConTeXt\footnote{\hyphenatedurl{http://www.cirp.ru/conferences/new neighborhood policy/publications/frellesen paper.doc}} \stoptext Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 13:12 ` Philipp Gesang 2010-10-25 15:52 ` Steffen Wolfrum @ 2010-10-27 20:28 ` Steffen Wolfrum 2010-10-27 22:05 ` Philipp Gesang 1 sibling, 1 reply; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-27 20:28 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Hans Hagen, Taco Hoekwater Hi, I tried an other approach: \useURL But here the letterpercent trick doesn't work at all ... ie. there is no clickable link at all anymore! \setupinteraction [state=start] \showframe \starttext \useURL[aurl] [http://www.kommers.se/upload/Analysarkiv/In\letterpercent English/Analyses/Woolcock\letterpercent paper\letterpercent on\letterpercent impact\letterpercent of\letterpercent Lisbontreaty\letterpercent on\letterpercent tradepolicy.pdf] [] [http://www.kommers.se/upload/Analysarkiv/In\letterpercent English/Analyses/Woolcock\letterpercent paper\letterpercent on\letterpercent impact\letterpercent of\letterpercent Lisbontreaty\letterpercent on\letterpercent tradepolicy.pdf] test \from[aurl] text \stoptext Steffen Am 25.10.2010 um 15:12 schrieb Philipp Gesang: > On 2010-10-25 <12:45:17>, Steffen Wolfrum wrote: >> >> Am 25.10.2010 um 12:26 schrieb Philipp Gesang: >>> \unexpanded\gdef\hyphenatedurl >>> >>> Should work in footnotes. Regards, Philipp >> >> >> No, it doesn't (see below). >> Do you have an other idea? > > Right; it works in footnotes but doesn’t accomplish what you > want. Sorry, I tried a lot but ‘\letterpercent’ is the only > way it works for me. > > Concerning the urlencoding I referred to browsers automatically > converting raw urls, like for instance > > http://www.google.com/search?q=ähre > > , which is encoded as > > http://www.google.com/search?q=%C3%A4hre > > by my browser. As long as your urls mainly consist of unicode > strings you might not need the actual (ascii) percent sign. In > this case you could be fine simply by converting strings like > ‘%C3%A4hre’ to ‘Ähre’, rendering urls percent-less, and rely on > the browsers to re-encode them on the fly. Might be a bit far > fetched, though. > > Philipp > > >> >> Thanks, Steffen >> (ConTeXt ver: 2010.10.21) >> >> >> Runaway argument? >> {test \hyphenatedurl {www.test\par \stoptext \par >> ! File ended while scanning use of \@@notemakedescription. >> >> system > error on line 0 in file : File ended while scanning use of \@@notemakedescription ... >> >> >> \let\normalhyphenatedurl\hyphenatedurl >> >> \bgroup >> >> \catcode`\%=11 >> >> \unexpanded\gdef\hyphenatedurl >> {\bgroup >> \catcode`\%=11 >> \expandafter\egroup >> \normalhyphenatedurl} >> >> \egroup >> >> \setupinteraction >> [state=start] >> >> \starttext >> >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >> >> \stoptext >> >> >> >> >> ___________________________________________________________________________________ >> 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 >> ___________________________________________________________________________________ > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 20:28 ` Steffen Wolfrum @ 2010-10-27 22:05 ` Philipp Gesang 2010-10-28 6:46 ` Steffen Wolfrum 0 siblings, 1 reply; 43+ messages in thread From: Philipp Gesang @ 2010-10-27 22:05 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 6813 bytes --] On 2010-10-27 <22:28:56>, Steffen Wolfrum wrote: > > Hi, > > I tried an other approach: \useURL > > But here the letterpercent trick doesn't work at all ... ie. > there is no clickable link at all anymore! Hi Steffen, if you consider an environment-style version of ‘\useURL’ appropriate, you could hack your way through like this: ···8<···························································· \setupinteraction[state=start] \unprotect \newcatcodetable \urlcatcodes \startcatcodetable \urlcatcodes \catcode`\^^I = 10 \catcode`\^^M = 5 \catcode`\^^L = 5 \catcode`\ = 10 \catcode`\^^Z = 9 \catcode`\\ = 0 \catcode`\{ = 1 \catcode`\} = 2 \catcode`\$ = \@@other \catcode`\& = \@@other \catcode`\# = \@@other \catcode`\^ = \@@other \catcode`\_ = \@@other \catcode`\~ = \@@other \catcode`\| = \@@other \catcode`\% = \@@other \catcode`\* = \@@other \stopcatcodetable \startluacode function structures.references.urls.get(name,method,space) local u = structures.references.urls.data[name] if u then local url, file = u[1], u[2] if file and file ~= "" then context("%s/%s",url,file) else context.pushcatcodes("vrb") context(url) context.popcatcodes() end end end \stopluacode \def\startuseURL{% \bgroup% \catcodetable \urlcatcodes \dodoubleempty\dostartuseURL% } \let\stopuseURL\relax \def\dostartuseURL[#1][#2]#3\stopuseURL{ \egroup \ctxlua{structures.references.urls.define("#1",string.strip(\!!bs\detokenize{#3}\!!es),"",\!!bs\detokenize{#2}\!!es)} } % Usage example here: \startuseURL[anotherurl][urldescription] http://test%it.example.com \stopuseURL \starttext \from[anotherurl]\par \url[anotherurl]\par Test.\footnote{\url[anotherurl]} \stoptext ···8<···························································· This deviates from standard ‘\useURL’ in the order of parameters: \startuseURL[#1][#2] #3 \stopuseURL where #1 is the id, #2 is the display text and #3 the url itself. This eliminates the need to resort to ‘\letterpercent’ as well and works in footnotes. Philipp > > > \setupinteraction > [state=start] > > \showframe > > \starttext > > \useURL[aurl] [http://www.kommers.se/upload/Analysarkiv/In\letterpercent English/Analyses/Woolcock\letterpercent paper\letterpercent on\letterpercent impact\letterpercent of\letterpercent Lisbontreaty\letterpercent on\letterpercent tradepolicy.pdf] [] [http://www.kommers.se/upload/Analysarkiv/In\letterpercent English/Analyses/Woolcock\letterpercent paper\letterpercent on\letterpercent impact\letterpercent of\letterpercent Lisbontreaty\letterpercent on\letterpercent tradepolicy.pdf] > > test \from[aurl] text > \stoptext > > > > > Steffen > > > > > > > Am 25.10.2010 um 15:12 schrieb Philipp Gesang: > > > On 2010-10-25 <12:45:17>, Steffen Wolfrum wrote: > >> > >> Am 25.10.2010 um 12:26 schrieb Philipp Gesang: > >>> \unexpanded\gdef\hyphenatedurl > >>> > >>> Should work in footnotes. Regards, Philipp > >> > >> > >> No, it doesn't (see below). > >> Do you have an other idea? > > > > Right; it works in footnotes but doesn’t accomplish what you > > want. Sorry, I tried a lot but ‘\letterpercent’ is the only > > way it works for me. > > > > Concerning the urlencoding I referred to browsers automatically > > converting raw urls, like for instance > > > > http://www.google.com/search?q=ähre > > > > , which is encoded as > > > > http://www.google.com/search?q=%C3%A4hre > > > > by my browser. As long as your urls mainly consist of unicode > > strings you might not need the actual (ascii) percent sign. In > > this case you could be fine simply by converting strings like > > ‘%C3%A4hre’ to ‘Ähre’, rendering urls percent-less, and rely on > > the browsers to re-encode them on the fly. Might be a bit far > > fetched, though. > > > > Philipp > > > > > >> > >> Thanks, Steffen > >> (ConTeXt ver: 2010.10.21) > >> > >> > >> Runaway argument? > >> {test \hyphenatedurl {www.test\par \stoptext \par > >> ! File ended while scanning use of \@@notemakedescription. > >> > >> system > error on line 0 in file : File ended while scanning use of \@@notemakedescription ... > >> > >> > >> \let\normalhyphenatedurl\hyphenatedurl > >> > >> \bgroup > >> > >> \catcode`\%=11 > >> > >> \unexpanded\gdef\hyphenatedurl > >> {\bgroup > >> \catcode`\%=11 > >> \expandafter\egroup > >> \normalhyphenatedurl} > >> > >> \egroup > >> > >> \setupinteraction > >> [state=start] > >> > >> \starttext > >> > >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > >> > >> \stoptext > >> > >> > >> > >> > >> ___________________________________________________________________________________ > >> 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 > >> ___________________________________________________________________________________ > > ___________________________________________________________________________________ > > 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 > > ___________________________________________________________________________________ > > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments [-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 22:05 ` Philipp Gesang @ 2010-10-28 6:46 ` Steffen Wolfrum 2010-10-28 7:38 ` Peter Münster 2010-10-28 8:03 ` Philipp Gesang 0 siblings, 2 replies; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-28 6:46 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Philipp Gesang Am 28.10.2010 um 00:05 schrieb Philipp Gesang: > % Usage example here: > > \startuseURL[anotherurl][urldescription] > http://test%it.example.com > \stopuseURL > > \starttext > > \from[anotherurl]\par > \url[anotherurl]\par > > Test.\footnote{\url[anotherurl]} > > \stoptext Hi Philipp, this doesn't work ... the address gets corrupt! Just run it, open the PDF in Acrobat and test the link: "Acrobat is attempting to connect to http://test%25it.example.com" Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-28 6:46 ` Steffen Wolfrum @ 2010-10-28 7:38 ` Peter Münster 2010-10-28 8:03 ` Philipp Gesang 1 sibling, 0 replies; 43+ messages in thread From: Peter Münster @ 2010-10-28 7:38 UTC (permalink / raw) To: mailing list for ConTeXt users On Thu, Oct 28 2010, Steffen Wolfrum wrote: > > > \startuseURL[anotherurl][urldescription] > > http://test%it.example.com > > \stopuseURL > > this doesn't work ... the address gets corrupt! > > Just run it, open the PDF in Acrobat and test the link: > > "Acrobat is attempting to connect to > http://test%25it.example.com" This is normal behaviour of Acrobat, see also: http://archive.contextgarden.net/message/20101027.213001.ba65dced.en.html "it" is not hexadecimal. Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-28 6:46 ` Steffen Wolfrum 2010-10-28 7:38 ` Peter Münster @ 2010-10-28 8:03 ` Philipp Gesang 1 sibling, 0 replies; 43+ messages in thread From: Philipp Gesang @ 2010-10-28 8:03 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1993 bytes --] On 2010-10-28 <08:46:55>, Steffen Wolfrum wrote: > > Am 28.10.2010 um 00:05 schrieb Philipp Gesang: > > > % Usage example here: > > > > \startuseURL[anotherurl][urldescription] > > http://test%it.example.com > > \stopuseURL > > > > \starttext > > > > \from[anotherurl]\par > > \url[anotherurl]\par > > > > Test.\footnote{\url[anotherurl]} > > > > \stoptext > > > > Hi Philipp, > > this doesn't work ... the address gets corrupt! > > Just run it, open the PDF in Acrobat and test the link: > > "Acrobat is attempting to connect to > http://test%25it.example.com" This can’t get corrupted any more because it’s illegal. From RFC 1738: ···8<···························································· hostname = *[ domainlabel "." ] toplabel domainlabel = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit ···8<···························································· No percent signs allowed in the hostname. Put your test percent sign somewhere else and it will work (don’t know about acrobat, but okular cooperates): http://testit.example.com/%25 http://www.google.com/search?q=L%C3%A4rmbel%C3%A4stigung Hth, Philipp > > > Steffen > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments [-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 9:16 ` Philipp Gesang 2010-10-25 9:39 ` Steffen Wolfrum @ 2010-10-25 10:06 ` Steffen Wolfrum 1 sibling, 0 replies; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-25 10:06 UTC (permalink / raw) To: mailing list for ConTeXt users Am 25.10.2010 um 11:16 schrieb Philipp Gesang: > text\footnote{test \hyphenatedurl{www.test\letterpercent it.com} test.} text. > > Regards, Philipp > > PS: As I understand, the percent sign appears mostly in > url-encoded strings. Couldn’t you just convert that to unicode > and let the browser do the re-encoding when the url is accessed? I am not sure what you mean ... when I enter the code as above pressing the link in Acrobat gives: http://www.test%25it.com So using \hyphenatedurl doesn't make sense anymore ... or did I miss the crucial part?! Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 8:25 hyphenated url Steffen Wolfrum 2010-10-25 9:16 ` Philipp Gesang @ 2010-10-25 17:30 ` Aditya Mahajan 2010-10-25 20:25 ` Steffen Wolfrum 2010-10-31 6:06 ` Aditya Mahajan 2 siblings, 1 reply; 43+ messages in thread From: Aditya Mahajan @ 2010-10-25 17:30 UTC (permalink / raw) To: mailing list for ConTeXt users On Mon, 25 Oct 2010, Steffen Wolfrum wrote: > Hi, > > the "%" is a frequently used character in URL. > But \hyphenatedurl{} can deal with it ... > > Does someone has a fix? > > > \starttext > text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > \stoptext An extreme solution: \startcatcodetable \txtcatcodes \catcode`\^^I = 10 \catcode`\^^M = 5 \catcode`\^^L = 5 \catcode`\ = 10 \catcode`\^^Z = 9 \catcode`\\ = 0 \catcode`\{ = 1 \catcode`\} = 2 % \catcode`\% = 14 \stopcatcodetable \starttext \asciimode text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. \stoptext 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: hyphenated url 2010-10-25 17:30 ` Aditya Mahajan @ 2010-10-25 20:25 ` Steffen Wolfrum 2010-10-25 21:00 ` Aditya Mahajan 0 siblings, 1 reply; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-25 20:25 UTC (permalink / raw) To: mailing list for ConTeXt users Am 25.10.2010 um 19:30 schrieb Aditya Mahajan: > On Mon, 25 Oct 2010, Steffen Wolfrum wrote: > >> Hi, >> >> the "%" is a frequently used character in URL. >> But \hyphenatedurl{} can deal with it ... >> >> Does someone has a fix? >> >> >> \starttext >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >> \stoptext > > An extreme solution: > > \startcatcodetable \txtcatcodes > \catcode`\^^I = 10 > \catcode`\^^M = 5 > \catcode`\^^L = 5 > \catcode`\ = 10 > \catcode`\^^Z = 9 > \catcode`\\ = 0 > \catcode`\{ = 1 > \catcode`\} = 2 > % \catcode`\% = 14 > \stopcatcodetable > \starttext > \asciimode > text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > \stoptext As I don't have any experience with "\asciimode" "I am not sure if I can map this entirely on a complex book project... Any known side-effects? Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 20:25 ` Steffen Wolfrum @ 2010-10-25 21:00 ` Aditya Mahajan 2010-10-25 21:47 ` Wolfgang Schuster 2010-10-25 22:49 ` Philipp Gesang 0 siblings, 2 replies; 43+ messages in thread From: Aditya Mahajan @ 2010-10-25 21:00 UTC (permalink / raw) To: Steffen Wolfrum; +Cc: mailing list for ConTeXt users On Mon, 25 Oct 2010, Steffen Wolfrum wrote: > > Am 25.10.2010 um 19:30 schrieb Aditya Mahajan: > >> On Mon, 25 Oct 2010, Steffen Wolfrum wrote: >> >>> Hi, >>> >>> the "%" is a frequently used character in URL. >>> But \hyphenatedurl{} can deal with it ... >>> >>> Does someone has a fix? >>> >>> >>> \starttext >>> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >>> \stoptext >> >> An extreme solution: >> >> \startcatcodetable \txtcatcodes >> \catcode`\^^I = 10 >> \catcode`\^^M = 5 >> \catcode`\^^L = 5 >> \catcode`\ = 10 >> \catcode`\^^Z = 9 >> \catcode`\\ = 0 >> \catcode`\{ = 1 >> \catcode`\} = 2 >> % \catcode`\% = 14 >> \stopcatcodetable >> \starttext >> \asciimode >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >> \stoptext > > > > As I don't have any experience with "\asciimode" "I am not sure if I can map this entirely on a complex book project... In addition to usual asciimode, I changed the definition so that % does not have its usual meaning. So, % is no longer a comment; it just typesets percentage sign. You can get a comment using \starthiding ... \stophiding. > Any known side-effects? * You need to use \math{...} to go into math mode. $ will just give a dollar. * You need \startformula ... \stopformula to go into display math. $$...$$ will just print dollars. * _ in text mode will produce an underscore instead of an error. _ in math mode will work fine. The same for ^. * You need \starttex(something) (I don't remember on the top of my head) \def\whatever#1{...} \stoptex(something) to change the definition of a macro. I have never really tested it on a large document. Maybe you can just add this and see if everything compiles. 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: hyphenated url 2010-10-25 21:00 ` Aditya Mahajan @ 2010-10-25 21:47 ` Wolfgang Schuster 2010-10-25 22:49 ` Philipp Gesang 1 sibling, 0 replies; 43+ messages in thread From: Wolfgang Schuster @ 2010-10-25 21:47 UTC (permalink / raw) To: mailing list for ConTeXt users Am 25.10.2010 um 23:00 schrieb Aditya Mahajan: > In addition to usual asciimode, I changed the definition so that % does not have its usual meaning. So, % is no longer a comment; it just typesets percentage sign. You can get a comment using > > \starthiding ... \stophiding. But there is now command which end at the end of the line like a normal comment, maybe this should be added to luatex (like we have \Ustartmath ... \Ustopmath as alternative to $...$) >> Any known side-effects? > > * You need to use \math{...} to go into math mode. $ will just give a dollar. There is also \formula{...}. > * You need \startformula ... \stopformula to go into display math. > $$...$$ will just print dollars. > > * _ in text mode will produce an underscore instead of an error. _ in math mode will work fine. The same for ^. > > * You need > > \starttex(something) (I don't remember on the top of my head) > \def\whatever#1{...} > \stoptex(something) > > to change the definition of a macro. \starttexcode ... \stoptexcode Wolfgang ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 21:00 ` Aditya Mahajan 2010-10-25 21:47 ` Wolfgang Schuster @ 2010-10-25 22:49 ` Philipp Gesang 2010-10-26 8:57 ` Steffen Wolfrum 2010-10-27 10:35 ` Steffen Wolfrum 1 sibling, 2 replies; 43+ messages in thread From: Philipp Gesang @ 2010-10-25 22:49 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 3509 bytes --] On 2010-10-25 <17:00:39>, Aditya Mahajan wrote: > On Mon, 25 Oct 2010, Steffen Wolfrum wrote: > > > > >Am 25.10.2010 um 19:30 schrieb Aditya Mahajan: > > > >>On Mon, 25 Oct 2010, Steffen Wolfrum wrote: > >> > >>>Hi, > >>> > >>>the "%" is a frequently used character in URL. > >>>But \hyphenatedurl{} can deal with it ... > >>> > >>>Does someone has a fix? > >>> > >>> > >>>\starttext > >>>text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > >>>\stoptext > >> > >>An extreme solution: > >> > >>\startcatcodetable \txtcatcodes > >> \catcode`\^^I = 10 > >> \catcode`\^^M = 5 > >> \catcode`\^^L = 5 > >> \catcode`\ = 10 > >> \catcode`\^^Z = 9 > >> \catcode`\\ = 0 > >> \catcode`\{ = 1 > >> \catcode`\} = 2 > >>% \catcode`\% = 14 > >>\stopcatcodetable > >>\starttext > >>\asciimode > >>text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > >>\stoptext > > > > > > > >As I don't have any experience with "\asciimode" "I am not sure if I can map this entirely on a complex book project... > > In addition to usual asciimode, I changed the definition so that % > does not have its usual meaning. So, % is no longer a comment; it > just typesets percentage sign. You can get a comment using > > \starthiding ... \stophiding. > > >Any known side-effects? > > * You need to use \math{...} to go into math mode. $ will just give > a dollar. > > * You need \startformula ... \stopformula to go into display math. > $$...$$ will just print dollars. > > * _ in text mode will produce an underscore instead of an error. _ > in math mode will work fine. The same for ^. > > * You need > > \starttex(something) (I don't remember on the top of my head) > \def\whatever#1{...} > \stoptex(something) > > to change the definition of a macro. > > I have never really tested it on a large document. Maybe you can > just add this and see if everything compiles. Hi Aditya, Steffen and others, I was toying around with catcode tables too. Shouldn’t it suffice to simply change % to ‘other’? This way you can keep the dollar style math. Philipp ···8<···························································· \setupinteraction[state=start] \unprotect \newcatcodetable \urlcatcodes % ordinary \ctxcatcodes except for minor changes \startcatcodetable \urlcatcodes \catcode`\^^I = 10 \catcode`\^^M = 5 \catcode`\^^L = 5 \catcode`\ = 10 \catcode`\^^Z = 9 \catcode`\\ = 0 \catcode`\{ = 1 \catcode`\} = 2 \catcode`\$ = 3 \catcode`\& = 4 \catcode`\# = 6 \catcode`\^ = 7 \catcode`\_ = 8 \catcode`\~ = 13 \catcode`\| = 13 \catcode`\% = \@@other \catcode`\* = \@@comment % comment this out if you don’t need line comments \stopcatcodetable \protect \starttext \bgroup TEST \setcatcodetable \urlcatcodes \hyphenatedurl{www.test%it.com} * this should be treated as comment \footnote{ \hyphenatedurl{www.test%it.com} } Math mode: $(x)(y)\,(Fx\,.\,x=y\,.\supset\,Fy)$ TEST \egroup \stoptext ···8<···························································· -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments [-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --] [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 22:49 ` Philipp Gesang @ 2010-10-26 8:57 ` Steffen Wolfrum 2010-10-27 10:35 ` Steffen Wolfrum 1 sibling, 0 replies; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-26 8:57 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Philipp Gesang Hi Aditya, Philipp and all, thank you very much for your interesting ideas! As far as I understood, your starting point is to avoid "%" being treated as "comment" ... This is nice for controlled situations. But in real life projects there are many, various situations where the "%" is used and needed as "comment"! Isn't there a way to treat "%" as a regular character dedicated in the \hyphenatedurl{} environment only?? Steffen PS @ Philipp: Using "*" as line comment would start the problem again, as "*" is also a valid part of URL addresses ... of course we need to keep a character for comment. Am 26.10.2010 um 00:49 schrieb Philipp Gesang: > Hi Aditya, Steffen and others, > > I was toying around with catcode tables too. Shouldn’t it suffice > to simply change % to ‘other’? This way you can keep the dollar > style math. > > Philipp > > ···8<···························································· > > \setupinteraction[state=start] > > \unprotect > \newcatcodetable \urlcatcodes % ordinary \ctxcatcodes except for minor changes > \startcatcodetable \urlcatcodes > \catcode`\^^I = 10 > \catcode`\^^M = 5 > \catcode`\^^L = 5 > \catcode`\ = 10 > \catcode`\^^Z = 9 > \catcode`\\ = 0 > \catcode`\{ = 1 > \catcode`\} = 2 > \catcode`\$ = 3 > \catcode`\& = 4 > \catcode`\# = 6 > \catcode`\^ = 7 > \catcode`\_ = 8 > \catcode`\~ = 13 > \catcode`\| = 13 > \catcode`\% = \@@other > \catcode`\* = \@@comment % comment this out if you don’t need line comments > \stopcatcodetable > > \protect > > \starttext > > \bgroup > TEST > \setcatcodetable \urlcatcodes > \hyphenatedurl{www.test%it.com} > * this should be treated as comment > \footnote{ > \hyphenatedurl{www.test%it.com} > } > Math mode: $(x)(y)\,(Fx\,.\,x=y\,.\supset\,Fy)$ > TEST > \egroup > > \stoptext > > ···8<···························································· ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 22:49 ` Philipp Gesang 2010-10-26 8:57 ` Steffen Wolfrum @ 2010-10-27 10:35 ` Steffen Wolfrum 2010-10-27 12:43 ` Wolfgang Schuster 1 sibling, 1 reply; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-27 10:35 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Hans Hagen Am 26.10.2010 um 00:49 schrieb Philipp Gesang: > On 2010-10-25 <17:00:39>, Aditya Mahajan wrote: >> On Mon, 25 Oct 2010, Steffen Wolfrum wrote: >> >>> >>> Am 25.10.2010 um 19:30 schrieb Aditya Mahajan: >>> >>>> On Mon, 25 Oct 2010, Steffen Wolfrum wrote: >>>> >>>>> Hi, >>>>> >>>>> the "%" is a frequently used character in URL. >>>>> But \hyphenatedurl{} can deal with it ... >>>>> >>>>> Does someone has a fix? >>>>> >>>>> >>>>> \starttext >>>>> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >>>>> \stoptext >>>> >>>> An extreme solution: >>>> >>>> \startcatcodetable \txtcatcodes >>>> \catcode`\^^I = 10 >>>> \catcode`\^^M = 5 >>>> \catcode`\^^L = 5 >>>> \catcode`\ = 10 >>>> \catcode`\^^Z = 9 >>>> \catcode`\\ = 0 >>>> \catcode`\{ = 1 >>>> \catcode`\} = 2 >>>> % \catcode`\% = 14 >>>> \stopcatcodetable >>>> \starttext >>>> \asciimode >>>> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >>>> \stoptext >>> >>> >>> >>> As I don't have any experience with "\asciimode" "I am not sure if I can map this entirely on a complex book project... >> >> In addition to usual asciimode, I changed the definition so that % >> does not have its usual meaning. So, % is no longer a comment; it >> just typesets percentage sign. You can get a comment using >> >> \starthiding ... \stophiding. >> >>> Any known side-effects? >> >> * You need to use \math{...} to go into math mode. $ will just give >> a dollar. >> >> * You need \startformula ... \stopformula to go into display math. >> $$...$$ will just print dollars. >> >> * _ in text mode will produce an underscore instead of an error. _ >> in math mode will work fine. The same for ^. >> >> * You need >> >> \starttex(something) (I don't remember on the top of my head) >> \def\whatever#1{...} >> \stoptex(something) >> >> to change the definition of a macro. >> >> I have never really tested it on a large document. Maybe you can >> just add this and see if everything compiles. > > Hi Aditya, Steffen and others, > > I was toying around with catcode tables too. Shouldn’t it suffice > to simply change % to ‘other’? This way you can keep the dollar > style math. > > Philipp > > ···8<···························································· > > \setupinteraction[state=start] > > \unprotect > \newcatcodetable \urlcatcodes % ordinary \ctxcatcodes except for minor changes > \startcatcodetable \urlcatcodes > \catcode`\^^I = 10 > \catcode`\^^M = 5 > \catcode`\^^L = 5 > \catcode`\ = 10 > \catcode`\^^Z = 9 > \catcode`\\ = 0 > \catcode`\{ = 1 > \catcode`\} = 2 > \catcode`\$ = 3 > \catcode`\& = 4 > \catcode`\# = 6 > \catcode`\^ = 7 > \catcode`\_ = 8 > \catcode`\~ = 13 > \catcode`\| = 13 > \catcode`\% = \@@other > \catcode`\* = \@@comment % comment this out if you don’t need line comments > \stopcatcodetable > > \protect > > \starttext > > \bgroup > TEST > \setcatcodetable \urlcatcodes > \hyphenatedurl{www.test%it.com} > * this should be treated as comment > \footnote{ > \hyphenatedurl{www.test%it.com} > } > Math mode: $(x)(y)\,(Fx\,.\,x=y\,.\supset\,Fy)$ > TEST > \egroup > > \stoptext > > ···8<···························································· Hi Hans and other catcode wizards, isn't there a way to make this kind of catcode trickery only be available *inside* \hyphenatedurl{} environment? Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 10:35 ` Steffen Wolfrum @ 2010-10-27 12:43 ` Wolfgang Schuster 2010-10-27 14:56 ` Peter Münster 2010-10-28 6:53 ` Taco Hoekwater 0 siblings, 2 replies; 43+ messages in thread From: Wolfgang Schuster @ 2010-10-27 12:43 UTC (permalink / raw) To: mailing list for ConTeXt users Am 27.10.2010 um 12:35 schrieb Steffen Wolfrum: > Hi Hans and other catcode wizards, > > isn't there a way to make this kind of catcode trickery only be available *inside* \hyphenatedurl{} environment? It’s useless in this case because the „%“ is read from the footnote before \hyphenatedurl can see it and any local catcode changes have therefore no effect. Wolfgang ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 12:43 ` Wolfgang Schuster @ 2010-10-27 14:56 ` Peter Münster 2010-10-27 15:11 ` Steffen Wolfrum 2010-10-27 15:59 ` Wolfgang Schuster 2010-10-28 6:53 ` Taco Hoekwater 1 sibling, 2 replies; 43+ messages in thread From: Peter Münster @ 2010-10-27 14:56 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Oct 27 2010, Wolfgang Schuster wrote: > > > isn't there a way to make this kind of catcode trickery only be available > > *inside* \hyphenatedurl{} environment? > > It’s useless in this case because the „%“ is read from the footnote before > \hyphenatedurl can see it and any local catcode changes have therefore no > effect. He wants perhaps: \starthyphenatedurl www.%.com \stophyphenatedurl Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 14:56 ` Peter Münster @ 2010-10-27 15:11 ` Steffen Wolfrum 2010-10-27 15:59 ` Wolfgang Schuster 1 sibling, 0 replies; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-27 15:11 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Peter Münster Am 27.10.2010 um 16:56 schrieb Peter Münster: > On Wed, Oct 27 2010, Wolfgang Schuster wrote: >> >>> isn't there a way to make this kind of catcode trickery only be available >>> *inside* \hyphenatedurl{} environment? >> >> It’s useless in this case because the „%“ is read from the footnote before >> \hyphenatedurl can see it and any local catcode changes have therefore no >> effect. > > He wants perhaps: > > \starthyphenatedurl > www.%.com > \stophyphenatedurl I just want to typeset ... test\footnote{test \hyphenatedurl{http://www.kommers.se/upload/Analysarkiv/In%20English/Analyses/Woolcock%20paper%20on%20impact%20of%20Lisbontreaty%20on%20tradepolicy.pdf} text.} text. ... without killing all these comment characters "%" used in my project! Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 14:56 ` Peter Münster 2010-10-27 15:11 ` Steffen Wolfrum @ 2010-10-27 15:59 ` Wolfgang Schuster 2010-10-27 16:20 ` Thomas A. Schmitz 2010-10-27 17:08 ` Peter Münster 1 sibling, 2 replies; 43+ messages in thread From: Wolfgang Schuster @ 2010-10-27 15:59 UTC (permalink / raw) To: mailing list for ConTeXt users Am 27.10.2010 um 16:56 schrieb Peter Münster: > On Wed, Oct 27 2010, Wolfgang Schuster wrote: >> >>> isn't there a way to make this kind of catcode trickery only be available >>> *inside* \hyphenatedurl{} environment? >> >> It’s useless in this case because the „%“ is read from the footnote before >> \hyphenatedurl can see it and any local catcode changes have therefore no >> effect. > > He wants perhaps: > > \starthyphenatedurl > www.%.com > \stophyphenatedurl No, he wants \footnote{...\hyphenatedurl{...%...}...} and before \hyphenatedurl can take a look at the content and change the % to a normal character the footnote already interpreted it as a comment and it’s gone. What you can do is to redefine \footnote to read it’s content with a different catcode regime or you use Adityas modified \asciicode command which makes % a printable character but you loose then comments (and \starthiding/\stophiding does not count as comment). Wolfgang ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 15:59 ` Wolfgang Schuster @ 2010-10-27 16:20 ` Thomas A. Schmitz 2010-10-27 17:08 ` Peter Münster 1 sibling, 0 replies; 43+ messages in thread From: Thomas A. Schmitz @ 2010-10-27 16:20 UTC (permalink / raw) To: mailing list for ConTeXt users On Oct 27, 2010, at 5:59 PM, Wolfgang Schuster wrote: > and before \hyphenatedurl can take a look at the content and change the % to a normal character the footnote already interpreted it as a comment and it’s gone. So even \scantokens wouldn't work here? Thomas ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 15:59 ` Wolfgang Schuster 2010-10-27 16:20 ` Thomas A. Schmitz @ 2010-10-27 17:08 ` Peter Münster 2010-10-27 17:22 ` Peter Münster 2010-10-28 9:03 ` Hans Hagen 1 sibling, 2 replies; 43+ messages in thread From: Peter Münster @ 2010-10-27 17:08 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Oct 27 2010, Wolfgang Schuster wrote: > > > He wants perhaps: > > > > \starthyphenatedurl > > www.%.com > > \stophyphenatedurl > > No, he wants > > \footnote{...\hyphenatedurl{...%...}...} Yes. But if I understand TeX right, then there will be only 2 possibilities: 1.) \footnote{bla \starthyphenatedurl www.%.com \stophyphenatedurl bla bla} or 2.) \ChangeCatcodeOfPercent \footnote{...\hyphenatedurl{...%...}...} \RestoreCatcodeOfPercent Is this right? Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 17:08 ` Peter Münster @ 2010-10-27 17:22 ` Peter Münster 2010-10-27 18:31 ` Aditya Mahajan 2010-10-28 9:03 ` Hans Hagen 1 sibling, 1 reply; 43+ messages in thread From: Peter Münster @ 2010-10-27 17:22 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Oct 27 2010, Peter Münster wrote: > Yes. But if I understand TeX right, then there will be only 2 possibilities: > > 1.) > \footnote{bla > \starthyphenatedurl > www.%.com > \stophyphenatedurl > bla bla} Ok, I must be wrong, because this does not work neither: \starttext bla \footnote{ bla \starttyping bla%bla \stoptyping bla } \stoptext Sorry, Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 17:22 ` Peter Münster @ 2010-10-27 18:31 ` Aditya Mahajan 2010-10-27 18:49 ` Peter Münster 0 siblings, 1 reply; 43+ messages in thread From: Aditya Mahajan @ 2010-10-27 18:31 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: TEXT/PLAIN, Size: 563 bytes --] On Wed, 27 Oct 2010, Peter Münster wrote: > On Wed, Oct 27 2010, Peter Münster wrote: > >> Yes. But if I understand TeX right, then there will be only 2 possibilities: >> >> 1.) >> \footnote{bla >> \starthyphenatedurl >> www.%.com >> \stophyphenatedurl >> bla bla} > > Ok, I must be wrong, because this does not work neither: > > \starttext > bla > \footnote{ > bla > \starttyping > bla%bla > \stoptyping > bla > } > \stoptext That has to do with the definition of typing: http://tracker.luatex.org/view.php?id=505 Aditya [-- Attachment #2: Type: text/plain, Size: 486 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 18:31 ` Aditya Mahajan @ 2010-10-27 18:49 ` Peter Münster 0 siblings, 0 replies; 43+ messages in thread From: Peter Münster @ 2010-10-27 18:49 UTC (permalink / raw) To: mailing list for ConTeXt users On Wed, Oct 27 2010, Aditya Mahajan wrote: > That has to do with the definition of typing: > http://tracker.luatex.org/view.php?id=505 Ah, that means, that buffers can solve the problem: \starttext \startbuffer \starttyping bla%bla \stoptyping \stopbuffer bla\footnote{ bla \getbuffer bla } \startbuffer bla%bla \stopbuffer bla\footnote{ bla \typebuffer bla } \startbuffer \type{bla%bla} \stopbuffer bla\footnote{bla\getbuffer bla} \stoptext Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 17:08 ` Peter Münster 2010-10-27 17:22 ` Peter Münster @ 2010-10-28 9:03 ` Hans Hagen 2010-10-28 9:53 ` Peter Münster 1 sibling, 1 reply; 43+ messages in thread From: Hans Hagen @ 2010-10-28 9:03 UTC (permalink / raw) To: mailing list for ConTeXt users On 27-10-2010 7:08, Peter Münster wrote: > On Wed, Oct 27 2010, Wolfgang Schuster wrote: >> >>> He wants perhaps: >>> >>> \starthyphenatedurl >>> www.%.com >>> \stophyphenatedurl >> >> No, he wants >> >> \footnote{...\hyphenatedurl{...%...}...} > > Yes. But if I understand TeX right, then there will be only 2 possibilities: > > 1.) > \footnote{bla > \starthyphenatedurl > www.%.com > \stophyphenatedurl > bla bla} \asciimode \catcode`\% = \othercatcode \footnote{bla \hyphenatedurl{www.%.com} bla bla} \stoptext If we can agree that asciimode also makes % a characters I can add that preset. In that case one should mark comments differently, although when one wants % to be % comments are not in the picture anyway. Hans ----------------------------------------------------------------- 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] 43+ messages in thread
* Re: hyphenated url 2010-10-28 9:03 ` Hans Hagen @ 2010-10-28 9:53 ` Peter Münster 2010-10-28 11:02 ` Khaled Hosny 0 siblings, 1 reply; 43+ messages in thread From: Peter Münster @ 2010-10-28 9:53 UTC (permalink / raw) To: mailing list for ConTeXt users On Thu, Oct 28 2010, Hans Hagen wrote: > If we can agree that asciimode also makes % a characters I can add > that preset. I agree. It's more consistent. Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-28 9:53 ` Peter Münster @ 2010-10-28 11:02 ` Khaled Hosny 2010-10-28 11:52 ` Peter Münster 2010-10-28 12:59 ` Wolfgang Schuster 0 siblings, 2 replies; 43+ messages in thread From: Khaled Hosny @ 2010-10-28 11:02 UTC (permalink / raw) To: mailing list for ConTeXt users On Thu, Oct 28, 2010 at 11:53:52AM +0200, Peter Münster wrote: > On Thu, Oct 28 2010, Hans Hagen wrote: > > > If we can agree that asciimode also makes % a characters I can add > > that preset. > > I agree. It's more consistent. Me too :) We just need some other way to put inline comments. Regards, Khaled -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-28 11:02 ` Khaled Hosny @ 2010-10-28 11:52 ` Peter Münster 2010-10-28 12:59 ` Wolfgang Schuster 1 sibling, 0 replies; 43+ messages in thread From: Peter Münster @ 2010-10-28 11:52 UTC (permalink / raw) To: mailing list for ConTeXt users On Thu, Oct 28 2010, Khaled Hosny wrote: > Me too :) We just need some other way to put inline comments. I don't know, if it's possible, but \% could be nice. Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-28 11:02 ` Khaled Hosny 2010-10-28 11:52 ` Peter Münster @ 2010-10-28 12:59 ` Wolfgang Schuster 1 sibling, 0 replies; 43+ messages in thread From: Wolfgang Schuster @ 2010-10-28 12:59 UTC (permalink / raw) To: mailing list for ConTeXt users Am 28.10.2010 um 13:02 schrieb Khaled Hosny: > On Thu, Oct 28, 2010 at 11:53:52AM +0200, Peter Münster wrote: >> On Thu, Oct 28 2010, Hans Hagen wrote: >> >>> If we can agree that asciimode also makes % a characters I can add >>> that preset. >> >> I agree. It's more consistent. > > Me too :) We just need some other way to put inline comments. \bgroup \obeylines \gdef\hide% {\begingroup% \obeylines% \dohide} \gdef\dohide#1 {\endgroup} \egroup \starttext Auf% ligature lage Auf\hide ligature lage \stoptext Wolfgang ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-27 12:43 ` Wolfgang Schuster 2010-10-27 14:56 ` Peter Münster @ 2010-10-28 6:53 ` Taco Hoekwater 2010-10-28 12:06 ` hyphenated url (SOLVED) Steffen Wolfrum 2010-10-28 12:50 ` hyphenated url Wolfgang Schuster 1 sibling, 2 replies; 43+ messages in thread From: Taco Hoekwater @ 2010-10-28 6:53 UTC (permalink / raw) To: mailing list for ConTeXt users On 10/27/2010 02:43 PM, Wolfgang Schuster wrote: > > Am 27.10.2010 um 12:35 schrieb Steffen Wolfrum: > >> Hi Hans and other catcode wizards, >> >> isn't there a way to make this kind of catcode trickery only be available *inside* \hyphenatedurl{} environment? > > It’s useless in this case because the „%“ is read from the footnote before \hyphenatedurl can see it and any local catcode changes have therefore no effect. This works: \startbuffer [comurl] \catcode`\%=12 \hyphenatedurl{http://www.kommers.se/upload/Analysarkiv/In%20English/Analyses/Woolcock%20paper%20on%20impact%20of%20Lisbontreaty%20on%20tradepolicy.pdf} \stopbuffer \setupinteraction [state=start] \starttext test\footnote{test \getbuffer[comurl] text.} text. \stoptext ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url (SOLVED) 2010-10-28 6:53 ` Taco Hoekwater @ 2010-10-28 12:06 ` Steffen Wolfrum 2010-10-28 12:50 ` hyphenated url Wolfgang Schuster 1 sibling, 0 replies; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-28 12:06 UTC (permalink / raw) To: mailing list for ConTeXt users Cc: Hans Hagen, Taco Hoekwater, Peter Münster, Philipp Gesang Am 28.10.2010 um 08:53 schrieb Taco Hoekwater: > This works: > > \startbuffer [comurl] \catcode`\%=12 > \hyphenatedurl{... If I didn't overlook something, then this must be finally the solution: \startbuffer [comurl] \catcode`\%=12 \useURL[test][http://www.kommers.se/upload/Analysarkiv/In%20English/Analyses/Woolcock%20paper%20on%20impact%20of%20Lisbontreaty%20on%20tradepolicy.pdf][] [http://www.kommers.se/upload/Analysarkiv/In%20English/\crlf Analyses/Woolcock%20paper%20on%20impact%20of%20Lisb\crlf ontreaty%20on%20tradepolicy.pdf]\from[test] \stopbuffer \setupinteraction [state=start] \starttext test {\getbuffer[comurl]} text.% HEY! test \startfootnote test \getbuffer[comurl]\ text.% HEY! \stopfootnote{} text.% HEY! \stoptext Here, the "%" character can be used for URL, both in bodytext and footnote, but works as "comment", too. And we can at the same time manually break long URLs that are too weird for hyphenation by \hyphenatedurl. Thank you Taco, Peter, Philipp and Hans for your efforts ... and eventually getting all the pieces for this solution together!!! Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-28 6:53 ` Taco Hoekwater 2010-10-28 12:06 ` hyphenated url (SOLVED) Steffen Wolfrum @ 2010-10-28 12:50 ` Wolfgang Schuster 1 sibling, 0 replies; 43+ messages in thread From: Wolfgang Schuster @ 2010-10-28 12:50 UTC (permalink / raw) To: Taco Hoekwater; +Cc: mailing list for ConTeXt users Am 28.10.2010 um 08:53 schrieb Taco Hoekwater: > On 10/27/2010 02:43 PM, Wolfgang Schuster wrote: >> >> Am 27.10.2010 um 12:35 schrieb Steffen Wolfrum: >> >>> Hi Hans and other catcode wizards, >>> >>> isn't there a way to make this kind of catcode trickery only be available *inside* \hyphenatedurl{} environment? >> >> It’s useless in this case because the „%“ is read from the footnote before \hyphenatedurl can see it and any local catcode changes have therefore no effect. > > This works: > > \startbuffer [comurl] \catcode`\%=12 > \hyphenatedurl{http://www.kommers.se/upload/Analysarkiv/In%20English/Analyses/Woolcock%20paper%20on%20impact%20of%20Lisbontreaty%20on%20tradepolicy.pdf} > \stopbuffer > > \setupinteraction > [state=start] > > \starttext > > test\footnote{test \getbuffer[comurl] text.} text. > > \stoptext Sure but \getbuffer isn’t expanded when the footnote text is read by tex, when you look at the tuc file you can see the entry for the footnote is: titledata={ title="test \\getbuffer [comurl] text.", }, Wolfgang ___________________________________________________________________________________ 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] 43+ messages in thread
* Re: hyphenated url 2010-10-25 8:25 hyphenated url Steffen Wolfrum 2010-10-25 9:16 ` Philipp Gesang 2010-10-25 17:30 ` Aditya Mahajan @ 2010-10-31 6:06 ` Aditya Mahajan 2010-10-31 9:50 ` Steffen Wolfrum [not found] ` <FC31827A-E920-47C4-9287-8BEE605CE94D@st.estfiles.de> 2 siblings, 2 replies; 43+ messages in thread From: Aditya Mahajan @ 2010-10-31 6:06 UTC (permalink / raw) To: mailing list for ConTeXt users On Mon, 25 Oct 2010, Steffen Wolfrum wrote: > Hi, > > the "%" is a frequently used character in URL. > But \hyphenatedurl{} can deal with it ... > > Does someone has a fix? > > > \starttext > text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > \stoptext This is more a proof of concept so I did not take care of the optional argument of \footnote. \newcatcodetable \mytxtcatcodes \startcatcodetable \mytxtcatcodes \catcode`\^^I = 10 \catcode`\^^M = 5 \catcode`\^^L = 5 \catcode`\ = 10 \catcode`\^^Z = 9 \catcode`\\ = 0 \catcode`\{ = 1 \catcode`\} = 2 \stopcatcodetable \def\dosingleasciigroup#1% {\pushcatcodetable \setcatcodetable \mytxtcatcodes \def\next##1{#1{##1}\popcatcodetable}% \next} \def\setasciicommand#1% {\savenormalmeaning{#1}% \def#1{\dosingleasciigroup{\csname normal\strippedcsname#1\endcsname}}} \setasciicommand\footnote \setasciicommand\hyphenatedurl \starttext \hyphenatedurl{http://www.google.com/some%20thing} test \footnote{A footnote with a \bold{url} \hyphenatedurl{http://www.google.com/some%20thing}} \stoptext 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: hyphenated url 2010-10-31 6:06 ` Aditya Mahajan @ 2010-10-31 9:50 ` Steffen Wolfrum [not found] ` <FC31827A-E920-47C4-9287-8BEE605CE94D@st.estfiles.de> 1 sibling, 0 replies; 43+ messages in thread From: Steffen Wolfrum @ 2010-10-31 9:50 UTC (permalink / raw) To: mailing list for ConTeXt users Am 31.10.2010 um 07:06 schrieb Aditya Mahajan: > On Mon, 25 Oct 2010, Steffen Wolfrum wrote: > >> Hi, >> >> the "%" is a frequently used character in URL. >> But \hyphenatedurl{} can deal with it ... >> >> Does someone has a fix? >> >> >> \starttext >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >> \stoptext > > This is more a proof of concept so I did not take care of the optional argument of \footnote. > > \newcatcodetable \mytxtcatcodes > \startcatcodetable \mytxtcatcodes > \catcode`\^^I = 10 > \catcode`\^^M = 5 > \catcode`\^^L = 5 > \catcode`\ = 10 > \catcode`\^^Z = 9 > \catcode`\\ = 0 > \catcode`\{ = 1 > \catcode`\} = 2 > \stopcatcodetable > > \def\dosingleasciigroup#1% > {\pushcatcodetable > \setcatcodetable \mytxtcatcodes > \def\next##1{#1{##1}\popcatcodetable}% > \next} > > \def\setasciicommand#1% > {\savenormalmeaning{#1}% > \def#1{\dosingleasciigroup{\csname normal\strippedcsname#1\endcsname}}} > > \setasciicommand\footnote > \setasciicommand\hyphenatedurl > > \starttext > \hyphenatedurl{http://www.google.com/some%20thing} > test \footnote{A footnote with a \bold{url} \hyphenatedurl{http://www.google.com/some%20thing}} > > \stoptext A very nice and clean solution! Is it also possible to adapt it to useURL? \setasciicommand\useURL test \useURL[one][http://www.google.com/some%20thing][][http://www.google.com/some%20thing] text Thanks a lot, Steffen ___________________________________________________________________________________ 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] 43+ messages in thread
[parent not found: <FC31827A-E920-47C4-9287-8BEE605CE94D@st.estfiles.de>]
* Re: hyphenated url [not found] ` <FC31827A-E920-47C4-9287-8BEE605CE94D@st.estfiles.de> @ 2010-10-31 20:25 ` Aditya Mahajan 0 siblings, 0 replies; 43+ messages in thread From: Aditya Mahajan @ 2010-10-31 20:25 UTC (permalink / raw) To: Steffen Wolfrum; +Cc: mailing list for ConTeXt users [-- Attachment #1: Type: TEXT/PLAIN, Size: 976 bytes --] On Sun, 31 Oct 2010, Steffen Wolfrum wrote: > > Am 31.10.2010 um 07:06 schrieb Aditya Mahajan: > >> On Mon, 25 Oct 2010, Steffen Wolfrum wrote: >> >>> Hi, >>> >>> the "%" is a frequently used character in URL. >>> But \hyphenatedurl{} can deal with it ... >>> >>> Does someone has a fix? >>> >>> >>> \starttext >>> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. >>> \stoptext >> >> This is more a proof of concept so I did not take care of the optional argument of \footnote. >> > A very nice and clean solution! > > Is it also possible to adapt it to useURL? > > \setasciicommand\useURL > > test \useURL[one][http://www.google.com/some%20thing][][http://www.google.com/some%20thing] text It starts getting more confusing...the control passes from tex to luatex and then back to tex and at the last step ctxcatcodes are restored. I just bypassed the whole last leg. See the attached file for a working example. A proper fix is much more involved. Aditya [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: TEXT/x-tex; name=test.tex, Size: 2618 bytes --] \newcatcodetable \mytxtcatcodes \startcatcodetable \mytxtcatcodes \catcode`\^^I = 10 \catcode`\^^M = 5 \catcode`\^^L = 5 \catcode`\ = 10 \catcode`\^^Z = 9 \catcode`\\ = 0 \catcode`\{ = 1 \catcode`\} = 2 \stopcatcodetable \def\dosingleasciigroup#1% {\pushcatcodetable \setcatcodetable \mytxtcatcodes \def\next##1{#1{##1}\popcatcodetable}% \next} \def\dosingleasciiargument#1% {\pushcatcodetable \setcatcodetable \mytxtcatcodes \def\next[##1]{#1[##1]\popcatcodetable}% \dosingleargument\next} \def\doquadrupleasciiargument#1% {\pushcatcodetable \setcatcodetable \mytxtcatcodes \def\next[##1][##2][##3][##4]{#1[##1][##2][##3][##4]\popcatcodetable}% \doquadrupleargument\next} \def\setasciicommand#1#2%arguments cs {\savenormalmeaning{#2}% \def#2{#1{\csname normal\strippedcsname#2\endcsname}}} \setasciicommand\dosingleasciigroup\footnote \setasciicommand\dosingleasciigroup\hyphenatedurl % This does not work... possible because the context(...) function is using % ctxcatcodes rather than current catcodes. %\setasciicommand\dosingleasciigroup\dofromurldescription \setasciicommand\doquadrupleasciiargument\useURL % Not needed %\setasciicommand\dosingleasciiargument\from \startluacode local references = structures.references references.urls = references.urls or { } references.urls.data = references.urls.data or { } function references.from(name) local u = references.urls.data[name] if u then local url, file, description = u[1], u[2], u[3] if description ~= "" then -- context.dofromurldescription(description) -- AM: Changed this tex.sprint(tex.mytxtcatcodes, description) -- ok elseif file and file ~= "" then context.dofromurlliteral(url .. "/" .. file) else context.dofromurlliteral(url) end else local f = files[name] if f then local description, file = f[1], f[2] if description ~= "" then context.dofromfiledescription(description) else context.dofromfileliteral(file) end end end end \stopluacode \starttext \hyphenatedurl{http://www.google.com/some%20thing} test \footnote{A footnote with a \bold{url} \hyphenatedurl{http://www.google.com/some%20thing}} \useURL[one][http://www.google.com/some%20thing][][http://www.google.com/some%20thing] \from[one] \stoptext [-- Attachment #3: Type: text/plain, Size: 486 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] 43+ messages in thread
end of thread, other threads:[~2010-10-31 20:25 UTC | newest] Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-10-25 8:25 hyphenated url Steffen Wolfrum 2010-10-25 9:16 ` Philipp Gesang 2010-10-25 9:39 ` Steffen Wolfrum 2010-10-25 9:50 ` Philipp Gesang 2010-10-25 10:05 ` Steffen Wolfrum 2010-10-25 10:26 ` Philipp Gesang 2010-10-25 10:45 ` Steffen Wolfrum 2010-10-25 13:12 ` Philipp Gesang 2010-10-25 15:52 ` Steffen Wolfrum 2010-10-27 21:30 ` Peter Münster 2010-10-27 20:28 ` Steffen Wolfrum 2010-10-27 22:05 ` Philipp Gesang 2010-10-28 6:46 ` Steffen Wolfrum 2010-10-28 7:38 ` Peter Münster 2010-10-28 8:03 ` Philipp Gesang 2010-10-25 10:06 ` Steffen Wolfrum 2010-10-25 17:30 ` Aditya Mahajan 2010-10-25 20:25 ` Steffen Wolfrum 2010-10-25 21:00 ` Aditya Mahajan 2010-10-25 21:47 ` Wolfgang Schuster 2010-10-25 22:49 ` Philipp Gesang 2010-10-26 8:57 ` Steffen Wolfrum 2010-10-27 10:35 ` Steffen Wolfrum 2010-10-27 12:43 ` Wolfgang Schuster 2010-10-27 14:56 ` Peter Münster 2010-10-27 15:11 ` Steffen Wolfrum 2010-10-27 15:59 ` Wolfgang Schuster 2010-10-27 16:20 ` Thomas A. Schmitz 2010-10-27 17:08 ` Peter Münster 2010-10-27 17:22 ` Peter Münster 2010-10-27 18:31 ` Aditya Mahajan 2010-10-27 18:49 ` Peter Münster 2010-10-28 9:03 ` Hans Hagen 2010-10-28 9:53 ` Peter Münster 2010-10-28 11:02 ` Khaled Hosny 2010-10-28 11:52 ` Peter Münster 2010-10-28 12:59 ` Wolfgang Schuster 2010-10-28 6:53 ` Taco Hoekwater 2010-10-28 12:06 ` hyphenated url (SOLVED) Steffen Wolfrum 2010-10-28 12:50 ` hyphenated url Wolfgang Schuster 2010-10-31 6:06 ` Aditya Mahajan 2010-10-31 9:50 ` Steffen Wolfrum [not found] ` <FC31827A-E920-47C4-9287-8BEE605CE94D@st.estfiles.de> 2010-10-31 20:25 ` Aditya Mahajan
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).