On Mon, Jul 13, 2009 at 09:50, Hans Hagen wrote:
Mojca Miklavec wrote:
\def\startGNUPLOTpage {\begingroup\obeyMPlines\dostartGNUPLOTpage}
\long\def\dostartGNUPLOTpage#1\stopGNUPLOTpage {\endgroup\startMPpage#1\stopMPpage}
Thanks a lot!!! The magic apparently works. I don't understand what exactly the "obeylines" macro does (it seems that it just makes sure that none of line endings get lost, not even inside definition itself).
it is not relevant here i think; there was a time when mp could not handle long lines so mkii has the option to split the source into lines (after a ;) which then makes mp happy
that restriction is no longer there
The macro handles both MKII and MKIV and I had problem in MKII. Not all restrictions are gone now (I still get "memory limit exceeded" in MKIV) and even if MP handles long lines now ... I don't want to risk since the code is already there anyway.
I had enough problems convincing the macro itself to work (metapost was complaining about too long lines otherwise), but I would definitely not come to the idea of ending the group even before the real macro starts :)
oh? how old is your mp? can't you set the buffer to 200K in texmf.cnf?
That macro has been written back in 2006 I guess. I didn't try to remove newlines, but the output of gnuplot could be as long as 1 million characters or more, so it's better to keep the lines splitted. Not that those million characters would make sense: usually TeX complains first about memory limit exceeded, but soon after that (even in MKIV) metapost starts complaining. The TikZ terminal almost works and that one manages to digest the contents (it just takes forever before it's done). (The point is not me trying to remove the limitation locally as any other user will stumble upon the same limitation. I'll keep the newlines there.) To Vafa: I meant \obeyMPlines, not \obeylines, and that one behaves a bit different. Mojca