[metapost] strings with > 4000 characters

Nicola nvitacolonna at gmail.com
Mon Sep 12 15:42:25 CEST 2011

In article 
<CALBOmsad+S2kEptEDE=ct6ptBRZ24nscMxeS5VixQExUi+JM4Q at mail.gmail.com>,
 Mojca Miklavec <mojca.miklavec.lists at gmail.com> wrote:

> Dear list,
> I would like to ask if there is any trick that enables splitting
> strings with > 4000 characters.
> I would like to use
>     substring (10000,10006) of some string
> When drawing functions, one can scale down calculations towards lower
> numbers and with some special care, one can still make it work. Is
> there any similar trick (excluding metapost 2) for strings?

Three tricks come to my mind (all untested!):

1) Repeatedly eat chunks from your strings, e.g.

for i = 1 upto 5 : s := substring(2000,infinity) of s; endfor
s := substring(0,6) of s;

2) Set warningcheck:=0;

3) Use dviluatex as the TeX engine. For example, if the substrings are to be 
drawn as labels, you may write

picture l; l = btex \directlua { LUA CODE HERE } etex;

and make your calculations in Lua. I don't know Lua well enough to provide 
details, though.


More information about the metapost mailing list