From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/69117 Path: news.gmane.org!not-for-mail From: Steffen Wolfrum Newsgroups: gmane.comp.tex.context Subject: Re: break strings Date: Mon, 13 Jun 2011 15:07:46 +0200 Message-ID: References: <81BCF9A8-D19A-4DD3-91EE-C552023AA86E@st.estfiles.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307970480 3276 80.91.229.12 (13 Jun 2011 13:08:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2011 13:08:00 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 13 15:07:56 2011 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 1QW6s0-0002wR-A3 for gctc-ntg-context-518@m.gmane.org; Mon, 13 Jun 2011 15:07:56 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F251FCAD9D; Mon, 13 Jun 2011 15:07:54 +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 F9n-HpbCsgm7; Mon, 13 Jun 2011 15:07:52 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 42E6DCADA8; Mon, 13 Jun 2011 15:07:52 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1B295CADA8 for ; Mon, 13 Jun 2011 15:07:51 +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 95eyg+lDa4uh for ; Mon, 13 Jun 2011 15:07:48 +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 D9CB7CAD9D for ; Mon, 13 Jun 2011 15:07:48 +0200 (CEST) Original-Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.31.93]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p5DD7l7b031988 for ; Mon, 13 Jun 2011 15:07:48 +0200 Original-Received: from [89.247.67.106] (helo=[192.168.1.4]) by smtprelay05.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1QW6rr-0005Dj-8T for ntg-context@ntg.nl; Mon, 13 Jun 2011 15:07:47 +0200 In-Reply-To: X-Mailer: Apple Mail (2.1084) X-Df-Sender: 698580 X-Bayes-Prob: 0.006 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.67.31.93; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0eETp7MAD - ab370e468774 - 20110613 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:69117 Archived-At: Am 13.06.2011 um 14:19 schrieb luigi scarso: > On Mon, Jun 13, 2011 at 2:12 PM, Steffen Wolfrum wrote: >> Hi, >> >> say I have arbitrary string of alphanumeric characters: >> >> >> \starttext >> >> \showframe >> >> 9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu >> >> \stoptext > In mkiv make a lua script using gsub, i.e. something like > s='9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu' > s= string.gsub(s,'(.)',"%1\\hskip0sp") > > > \starttext > \startluacode > s='9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu' > s= string.gsub(s..s..s,'(.)',"%1\\hskip0sp") > context(s) > \stopluacode > \stoptext ... ok, compared to this solution it is for sure easier to manually add \crlf :o)) The background are hundreds of URL's, which are part of regular text ... now transformed in a complicated but working beast: \startbuffer[myurl:01]\catcode`\%=12 \catcode`\_=12 \catcode`\&=12 \catcode`\#=12\setupalign[line,block,hanging]\useURL[test][http://www.lfd.m-v.de/dschutz/beschlue/ent49.html#nr.5][][http://www.lfd.m-v.de/dschutz/beschlue/ent49.html#nr.5]\from[test]\removeunwantedspaces\stopbuffer\getbuffer[myurl:01] If I now again add your lines of luacode too, I go crazy :o) Is there no handy little context command that could just be pasted before the string, like the following? \useURL[...][...][][\ThisHelps 9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu] 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 ___________________________________________________________________________________