From: Steffen Wolfrum <context@st.estfiles.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: break strings
Date: Mon, 13 Jun 2011 15:07:46 +0200 [thread overview]
Message-ID: <D8127EF9-4449-4840-9A3C-8F42C06C3BD0@st.estfiles.de> (raw)
In-Reply-To: <BANLkTi=xS_uDciHe6go-JwHfGnBMFzPRQQ@mail.gmail.com>
Am 13.06.2011 um 14:19 schrieb luigi scarso:
> On Mon, Jun 13, 2011 at 2:12 PM, Steffen Wolfrum <context@st.estfiles.de> 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
___________________________________________________________________________________
next prev parent reply other threads:[~2011-06-13 13:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-13 12:12 Steffen Wolfrum
2011-06-13 12:19 ` luigi scarso
2011-06-13 13:07 ` Steffen Wolfrum [this message]
2011-06-13 12:25 ` Wolfgang Schuster
2011-06-13 13:18 ` Steffen Wolfrum
2011-06-13 13:40 ` luigi scarso
2011-06-13 13:52 ` Steffen Wolfrum
2011-06-13 13:59 ` luigi scarso
2011-06-13 13:58 ` Wolfgang Schuster
2011-06-13 14:02 ` luigi scarso
2011-06-13 20:19 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D8127EF9-4449-4840-9A3C-8F42C06C3BD0@st.estfiles.de \
--to=context@st.estfiles.de \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).