Am 13.06.2011 um 15:40 schrieb luigi scarso:
> On Mon, Jun 13, 2011 at 3:18 PM, Steffen Wolfrum <[email protected]>
> 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 : [email protected] / 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
___________________________________________________________________________________