From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/69121 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:52:18 +0200 Message-ID: References: <81BCF9A8-D19A-4DD3-91EE-C552023AA86E@st.estfiles.de> <8EA8D5E8-2692-4D13-881A-4D8E499BF803@googlemail.com> 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 1307973152 19201 80.91.229.12 (13 Jun 2011 13:52:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2011 13:52:32 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 13 15:52:28 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 1QW7Z5-0007Ck-Vq for gctc-ntg-context-518@m.gmane.org; Mon, 13 Jun 2011 15:52:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 78A2ACADA5; Mon, 13 Jun 2011 15:52:27 +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 8oOIxp22Tqwg; Mon, 13 Jun 2011 15:52:24 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CEC8FCAD9D; Mon, 13 Jun 2011 15:52:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6A728CAD9D for ; Mon, 13 Jun 2011 15:52:23 +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 S3piucRY+dUx for ; Mon, 13 Jun 2011 15:52:21 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 5A082CAD90 for ; Mon, 13 Jun 2011 15:52:21 +0200 (CEST) Original-Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.29.7]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p5DDqKgM016534 for ; Mon, 13 Jun 2011 15:52:20 +0200 Original-Received: from [89.247.67.106] (helo=[192.168.1.4]) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1QW7Yx-0006k4-Ni for ntg-context@ntg.nl; Mon, 13 Jun 2011 15:52:19 +0200 In-Reply-To: X-Mailer: Apple Mail (2.1084) X-Df-Sender: 698580 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.67.29.7; 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: 0bETpQkrF - 6b511cc7d08f - 20110613 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:69121 Archived-At: Am 13.06.2011 um 15:40 schrieb luigi scarso: > On Mon, Jun 13, 2011 at 3:18 PM, Steffen Wolfrum wrote: >> >> Am 13.06.2011 um 14:25 schrieb Wolfgang Schuster: >> >>> >>> Am 13.06.2011 um 14:12 schrieb Steffen Wolfrum: >>> >>>> Hi, >>>> >>>> say I have arbitrary string of alphanumeric characters: >>>> >>>> >>>> \starttext >>>> >>>> \showframe >>>> >>>> 9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu >>>> >>>> \stoptext >>>> >>>> How can I (automatically) force a break at end of line, without manually adding \crlf or \break at break points? >>> >>> \handletokens ...\with{\hskip 0pt plus .1pt\firstofoneargument} >> >> >> Yes, this helps: >> >> \showframe >> >> \define[1]\ThisHelps {\handletokens#1\with{\hskip 0pt plus .1pt\firstofoneargument}} >> >> Test text test text\ThisHelps {9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu} >> >> \stoptext >> >> >> Thank you!! >> >> Steffen > Where is the difference ? > > \starttext > > > \showframe > > \define[1]\ThisHelps {\handletokens#1\with{\hskip 0pt plus > .1pt\firstofoneargument}} > > Test text test text\ThisHelps > {9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu} > > \define[1]\ThisHelpsLuigi{% > \startluacode > s='#1' > s= string.gsub(s,'(.)',"\%1\\hskip0sp") > % maybe only some chars... > %s= string.gsub(s,'[=/]',"\%1\\hskip0sp") > context(s) > \stopluacode} > > Test text test text\ThisHelpsLuigi > {9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu} > > \stoptext Just my "greenness" with luacode ... I didn't expect that it could be wrapped so easily in an handy \define command: context(s) is wrapped in start/stopluacode is wrapped in \define[1]\LuigiHelps{...} Endless possibilities ... great! Thank you very much for making this clear :o) 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 ___________________________________________________________________________________