From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62996 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: hyphenated url Date: Thu, 28 Oct 2010 00:05:36 +0200 Message-ID: <20101027220536.GA11182@aides> References: <51241DF1-574E-4677-AED5-0D01225C8635@st.estfiles.de> <20101025091602.GA26195@aides> <20101025095024.GB26195@aides> <907A35C5-0380-4C63-B6B1-D26628EBD222@st.estfiles.de> <20101025102612.GC26195@aides> <46EA0AD9-208E-4566-B0F1-565B6552AC71@st.estfiles.de> <20101025131225.GA3920@orcus.urz.uni-heidelberg.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0125994159==" X-Trace: dough.gmane.org 1288217151 12976 80.91.229.12 (27 Oct 2010 22:05:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Oct 2010 22:05:51 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 28 00:05:50 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PBE7x-0001h1-3Q for gctc-ntg-context-518@m.gmane.org; Thu, 28 Oct 2010 00:05:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6F31AC9A7C; Thu, 28 Oct 2010 00:05:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6haSj77MMz9A; Thu, 28 Oct 2010 00:05:44 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0B17BCA781; Thu, 28 Oct 2010 00:05:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CA754CA781 for ; Thu, 28 Oct 2010 00:05:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sMV3E5wIXNda for ; Thu, 28 Oct 2010 00:05:39 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 4BBB5C9A7C for ; Thu, 28 Oct 2010 00:05:39 +0200 (CEST) Original-Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9RM5cW5020358 for ; Thu, 28 Oct 2010 00:05:38 +0200 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id o9RM5bSu030643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 28 Oct 2010 00:05:37 +0200 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id o9RM5bVj027174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 28 Oct 2010 00:05:37 +0200 Original-Received: from localhost (mnhm-4d0121ec.pool.mediaWays.net [77.1.33.236]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id o9RM5CCc014133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 28 Oct 2010 00:05:13 +0200 In-Reply-To: X-Operating-System: Linux aides 2.6.35-ARCH X-Polite-Request: "Please try to be nice, don't send html mail." User-Agent: Mutt/1.5.20 (2009-06-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.100.212; country=DE; region=01; city=Heidelberg; latitude=49.4167; longitude=8.7000; http://maps.google.com/maps?q=49.4167,8.7000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eDnW5CVB - a20e40368326 - 20101028 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:62996 Archived-At: --===============0125994159== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/9DWx/yDrRhgMJTb" Content-Disposition: inline --/9DWx/yDrRhgMJTb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2010-10-27 <22:28:56>, Steffen Wolfrum wrote: >=20 > Hi, >=20 > I tried an other approach: \useURL >=20 > 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 =E2=80=98\useURL=E2=80=99 appropriate, you could hack your way through like this: =C2=B7=C2=B7=C2=B78<=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7 \setupinteraction[state=3Dstart] \unprotect \newcatcodetable \urlcatcodes \startcatcodetable \urlcatcodes \catcode`\^^I =3D 10 \catcode`\^^M =3D 5 \catcode`\^^L =3D 5 \catcode`\ =3D 10 \catcode`\^^Z =3D 9 \catcode`\\ =3D 0 \catcode`\{ =3D 1 \catcode`\} =3D 2 \catcode`\$ =3D \@@other \catcode`\& =3D \@@other \catcode`\# =3D \@@other \catcode`\^ =3D \@@other \catcode`\_ =3D \@@other \catcode`\~ =3D \@@other \catcode`\| =3D \@@other \catcode`\% =3D \@@other \catcode`\* =3D \@@other \stopcatcodetable \startluacode function structures.references.urls.get(name,method,space) local u =3D structures.references.urls.data[name] if u then=20 local url, file =3D u[1], u[2]=20 if file and file ~=3D "" then=20 context("%s/%s",url,file) else=20 context.pushcatcodes("vrb") context(url) context.popcatcodes() end =20 end =20 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\detoken= ize{#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 =C2=B7=C2=B7=C2=B78<=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7 This deviates from standard =E2=80=98\useURL=E2=80=99 in the order of param= eters: \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 =E2=80=98\letterpercent=E2=80=99 as w= ell and works in footnotes. Philipp >=20 >=20 > \setupinteraction > [state=3Dstart] >=20 > \showframe >=20 > \starttext >=20 > \useURL[aurl] [http://www.kommers.se/upload/Analysarkiv/In\letterpe= rcent English/Analyses/Woolcock\letterpercent paper\letterpercent on\letter= percent impact\letterpercent of\letterpercent Lisbontreaty\letterpercent on= \letterpercent tradepolicy.pdf] [] [http://www.kommers.se/upload/Analysarki= v/In\letterpercent English/Analyses/Woolcock\letterpercent paper\letterperc= ent on\letterpercent impact\letterpercent of\letterpercent Lisbontreaty\let= terpercent on\letterpercent tradepolicy.pdf]=20 >=20 > test \from[aurl] text > \stoptext >=20 >=20 >=20 >=20 > Steffen >=20 >=20 >=20 >=20 >=20 >=20 > Am 25.10.2010 um 15:12 schrieb Philipp Gesang: >=20 > > On 2010-10-25 <12:45:17>, Steffen Wolfrum wrote: > >>=20 > >> Am 25.10.2010 um 12:26 schrieb Philipp Gesang: > >>> \unexpanded\gdef\hyphenatedurl > >>>=20 > >>> Should work in footnotes. Regards, Philipp > >>=20 > >>=20 > >> No, it doesn't (see below). > >> Do you have an other idea? > >=20 > > Right; it works in footnotes but doesn=E2=80=99t accomplish what you > > want. Sorry, I tried a lot but =E2=80=98\letterpercent=E2=80=99 is the = only > > way it works for me. > >=20 > > Concerning the urlencoding I referred to browsers automatically > > converting raw urls, like for instance > >=20 > > http://www.google.com/search?q=3D=C3=A4hre > >=20 > > , which is encoded as > >=20 > > http://www.google.com/search?q=3D%C3%A4hre > >=20 > > 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 > > =E2=80=98%C3%A4hre=E2=80=99 to =E2=80=98=C3=84hre=E2=80=99, rendering u= rls percent-less, and rely on > > the browsers to re-encode them on the fly. Might be a bit far > > fetched, though. > >=20 > > Philipp > >=20 > >=20 > >>=20 > >> Thanks, Steffen > >> (ConTeXt ver: 2010.10.21) > >>=20 > >>=20 > >> Runaway argument? > >> {test \hyphenatedurl {www.test\par \stoptext \par=20 > >> ! File ended while scanning use of \@@notemakedescription. > >>=20 > >> system > error on line 0 in file : File ended while scanning = use of \@@notemakedescription ... > >>=20 > >>=20 > >> \let\normalhyphenatedurl\hyphenatedurl > >>=20 > >> \bgroup > >>=20 > >> \catcode`\%=3D11 > >>=20 > >> \unexpanded\gdef\hyphenatedurl > >> {\bgroup > >> \catcode`\%=3D11 > >> \expandafter\egroup > >> \normalhyphenatedurl} > >>=20 > >> \egroup > >>=20 > >> \setupinteraction > >> [state=3Dstart] > >>=20 > >> \starttext > >>=20 > >> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text. > >>=20 > >> \stoptext > >>=20 > >>=20 > >>=20 > >>=20 > >> ______________________________________________________________________= _____________ > >> If your question is of interest to others as well, please add an entry= to the Wiki! > >>=20 > >> 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! > >=20 > > 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 > > _______________________________________________________________________= ____________ >=20 > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to= the Wiki! >=20 > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --/9DWx/yDrRhgMJTb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAkzIojAACgkQ02lYlJYWs9KaWgCfTD+yovuggtR894lXabHcKuX3 zdgAn2TKR77d/NZv0seDqpgZRpgo1izR =cQfE -----END PGP SIGNATURE----- --/9DWx/yDrRhgMJTb-- --===============0125994159== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0125994159==--