On Mon, Jun 13, 2011 at 3:52 PM, Steffen Wolfrum
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{...} The key point is % maybe only some chars... %s= string.gsub(s,'[=/]',"\%1\\hskip0sp") With '[=/]' you define a set of chars (only '=' and '/' in this example) so that only '=' => '=\hskip0sp' and '/' => '/\hskip0sp' i.e. breaks appear only on '=' and '/'. It' possible to define whatever char you want, but you must pay attention to '%' '#' etc. (as you do with \catcode)
-- luigi