From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/84662 Path: news.gmane.org!not-for-mail From: Marco Patzer Newsgroups: gmane.comp.tex.context Subject: Re: hyphenate urls in a non hyphenated text Date: Tue, 8 Oct 2013 21:27:22 +0200 Message-ID: <20131008192722.GP18324@homerow> References: <52541804.1020908@stdin.fr> <52543B22.8000608@wxs.nl> <20131008173555.GO18324@homerow> <52545013.6050206@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0228224139==" X-Trace: ger.gmane.org 1381260450 17883 80.91.229.3 (8 Oct 2013 19:27:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2013 19:27:30 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 08 21:27:35 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VTcwQ-0000iI-FG for gctc-ntg-context-518@m.gmane.org; Tue, 08 Oct 2013 21:27:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 119FE101E7; Tue, 8 Oct 2013 21:25:03 +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 qKswqWGks8+l; Tue, 8 Oct 2013 21:25:01 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 069A3101DE; Tue, 8 Oct 2013 21:25:01 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 03E8C101DE for ; Tue, 8 Oct 2013 21:24:59 +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 wj2LqHC44O7P for ; Tue, 8 Oct 2013 21:24:58 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 0657710193 for ; Tue, 8 Oct 2013 21:24:57 +0200 (CEST) Original-Received: from forward3h.mail.yandex.net (forward3h.mail.yandex.net [IPv6:2a02:6b8:0:f05::3]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r98JRR72000388 for ; Tue, 8 Oct 2013 21:27:27 +0200 Original-Received: from smtp2h.mail.yandex.net (smtp2h.mail.yandex.net [84.201.187.145]) by forward3h.mail.yandex.net (Yandex) with ESMTP id A8C441361788 for ; Tue, 8 Oct 2013 23:27:26 +0400 (MSK) Original-Received: from smtp2h.mail.yandex.net (localhost [127.0.0.1]) by smtp2h.mail.yandex.net (Yandex) with ESMTP id 7991A170228A for ; Tue, 8 Oct 2013 23:27:26 +0400 (MSK) Original-Received: from unknown (unknown [83.68.239.193]) by smtp2h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UKOd3lH3A1-RPBWCFNH; Tue, 8 Oct 2013 23:27:25 +0400 Mail-Followup-To: ntg-context@ntg.nl In-Reply-To: <52545013.6050206@wxs.nl> X-PGP-Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xB8CFCB65D4F08C27 User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a02:6b8:0:f05::3; country=RU X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03KyHrrtV - a2189b91b033 - 20131008 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:84662 Archived-At: --===============0228224139== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nLMor0SRtNCuLS/8" Content-Disposition: inline --nLMor0SRtNCuLS/8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2013=E2=80=9310=E2=80=9308 Hans Hagen wrote: > On 10/8/2013 7:35 PM, Marco Patzer wrote: > >On 2013=E2=80=9310=E2=80=9308 Hans Hagen wrote: > > > >>>\hyphenateurl{} works only when setupalign[] is set to hyphenated. > >>> > >>>Is there a way to hyphenate only URLs? > >> > >>You need to provide a few more options to \setupalign: > > > >Why? > > > >>\appendtoks\tttf\to\everyhyphenatedurl % maybe we need a proper setup > > > >Isn't that what \url is for? It has a setup command and uses > >\hyphenatedurl. >=20 > sure, but it forces one to use \url which is not always an option > (if there are thousands embedded in the text) Valid point. > >I don't see a single hyphenated URL in your result. The OP failing > >to provide a minimal example, let me provide my interpretation of > >the problem: >=20 > This is more visible >=20 > \appendtoks\tttf\to\everyhyphenatedurl > \lefthyphenmin=3D100 \righthyphenmin=3D100 You URLs still don't hyphenate. Maybe we're misunderstanding each other here. > maybe this is s better definition of nohyphens: >=20 >=20 > \unexpanded\def\nohyphens > {\ifx\dohyphens\relax > \unexpanded\edef\dohyphens > {\lefthyphenmin\the\lefthyphenmin > \righthyphenmin\the\righthyphenmin > \relax}% > \fi > \lefthyphenmin\maxdimen > \righthyphenmin\maxdimen} > > [=E2=80=A6] > > needs a bit it tinkering, maybe this is nicer: >=20 > \unprotect >=20 > \unexpanded\def\nohyphens > {\ifx\dohyphens\relax > \unexpanded\edef\dohyphens > {\hyphenminoffset\the\hyphenminoffset\relax > \lang_basics_synchronize_min_max}% > \fi > \hyphenminoffset\plusthousand > \lang_basics_synchronize_min_max} >=20 > \protect >=20 > as it syncs nicely with languages too (characters carry left and > right values so inline changes are possible) That looks good. The OP should test it on his document. However, it has the implication that URLs are always hyphenated, as far as I can tell. But it is in fact a practical solution which is certainly what the user wants in almost all of the cases. I never had a document where URLs protruding into the margin was desired. Marco --nLMor0SRtNCuLS/8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iQEcBAEBAgAGBQJSVFyaAAoJEPGqVaNSn0iKH28H/iZgheclcCCaNsb9r05olai8 gRIyFDO5ohVS2xB4CYsUQEAzpueccrHGPXs7aK6gMQITV7X2zG5jq7npsj8sp28Z GhSkvlQW3Xd93SYYXy+i94GNa31EIScqk4Yjs++enIv7y3hRe5wmG4A/jmLLc5gU WtwCoIbMr72saPunftBgT26XofxfBBIoigVG3mjHovcUB4QlOjVqewjuy6l8B8/U EtV0AxVcsSjG9G3zHjFWCSmqA7RyDMUz7C0Yd9QWltd15Kxj77KLp9cTT22y405S hRfKgWjXtJIr9l3E2X4BuUJc+ZAmDWXAl16AcusnAAP46Wh1iDRTfc3+VthLARo= =PmmR -----END PGP SIGNATURE----- --nLMor0SRtNCuLS/8-- --===============0228224139== 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 ___________________________________________________________________________________ --===============0228224139==--