Re: [NTG-context] mplib messages

2012-11-12 Thread Hans Hagen

On 11/12/2012 10:43 AM, Alan BRASLAU wrote:

Hello,

Were do MetaPost messages go using mplib? (/dev/null?)
I see nothing on the console nor in the log file.

Alan

\starttext
\startMPpage
 message a circle ;
 draw fullcircle scaled 2 cm ;
\stopMPpage
\stoptext



\starttext

\ctxlua{metapost.showlog = true}

\startMPpage
message(message: a circle) ;
show(show: a circle) ;
draw fullcircle scaled 2 cm ;
\stopMPpage

\stoptext

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] mplib messages

2012-11-12 Thread Hans Hagen

On 11/12/2012 10:43 AM, Alan BRASLAU wrote:

Hello,

Were do MetaPost messages go using mplib? (/dev/null?)
I see nothing on the console nor in the log file.

Alan

\starttext
\startMPpage
 message a circle ;
 draw fullcircle scaled 2 cm ;
\stopMPpage
\stoptext


the next beta has:

\enabletrackers[metapost.showlog]

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] mplib messages

2012-11-12 Thread Alan BRASLAU
On Mon, 12 Nov 2012 10:59:04 +0100
Hans Hagen pra...@wxs.nl wrote:

 On 11/12/2012 10:43 AM, Alan BRASLAU wrote:
  Hello,
 
  Were do MetaPost messages go using mplib? (/dev/null?)
  I see nothing on the console nor in the log file.
 
  Alan
 
  \starttext
  \startMPpage
   message a circle ;
   draw fullcircle scaled 2 cm ;
  \stopMPpage
  \stoptext
 
 the next beta has:
 
 \enabletrackers[metapost.showlog]
 

Thanks

(Should this be enabled by default?)

Alan
___
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
___


Re: [NTG-context] mplib messages

2012-11-12 Thread luigi scarso
On Mon, Nov 12, 2012 at 12:24 PM, Alan BRASLAU alan.bras...@cea.fr wrote:

 On Mon, 12 Nov 2012 10:59:04 +0100
 Hans Hagen pra...@wxs.nl wrote:

  \enabletrackers[metapost.showlog]
 

 Thanks

 (Should this be enabled by default?)


hm, write on std{err,out} slows down the process

-- 
luigi
___
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
___

Re: [NTG-context] mplib messages

2012-11-12 Thread Alan BRASLAU
On Mon, 12 Nov 2012 12:29:41 +0100
luigi scarso luigi.sca...@gmail.com wrote:

 hm, write on std{err,out} slows down the process

But normally there should be very few messages,
as message and show should be used with parsimony...
(Indeed there are very few in the standard metapost and metafun macros)

Maybe in ConTeXt we should have a distinction in allowing
the turning on of one or the other (show, message and errmessage).

Alan
___
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
___


Re: [NTG-context] mplib messages

2012-11-12 Thread Aditya Mahajan

On Mon, 12 Nov 2012, luigi scarso wrote:


On Mon, Nov 12, 2012 at 12:24 PM, Alan BRASLAU alan.bras...@cea.fr wrote:


On Mon, 12 Nov 2012 10:59:04 +0100
Hans Hagen pra...@wxs.nl wrote:


\enabletrackers[metapost.showlog]



Thanks

(Should this be enabled by default?)



hm, write on std{err,out} slows down the process


There is always `context --noconsole` if you want to omit the messages. I 
think that it is a good idea to display messages by default, or better 
still, the logging and tracing macros of metapost and tex be enabled by a 
common interface.


Aditya

___
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
___


Re: [NTG-context] mplib messages

2012-11-12 Thread Alan BRASLAU
On Mon, 12 Nov 2012 10:59:04 +0100
Hans Hagen pra...@wxs.nl wrote:

 the next beta has:
 
 \enabletrackers[metapost.showlog]

produces:

metapost log: [1]

metapost log: (Please type a command or say `end')

Clearly we do not want to see this prompt...

Alan
___
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
___


Re: [NTG-context] mplib logging

2009-05-14 Thread Peter Rolf

Peter Rolf schrieb:

Hi,

how do I enable (verbose) logging of mplib? I have problems with a 
corrupt pdf (the last paint form xobject is empty: .../Fm6 Do Q 
endstream endobj). No errors or warnings in the ConTeXt log (actual? 
beta). The same code works with mkii. No minimal example yet.



found the culprit. i reuse (hashing) /FunctionType3 definitions and this 
is the cause of the trouble. there seems to be some runtime problems 
(time when object number is written) in my lua/tex code. in the breaking 
example the function definition was defined as obj 6 instead of the 
xobject form. without hashing ('old code kept for readability') there 
are no problems.


sorry for the noise.

Peter


Peter


___ 

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___ 





___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib logging

2009-05-13 Thread Hans Hagen

Peter Rolf wrote:

Hi,

how do I enable (verbose) logging of mplib? I have problems with a 
corrupt pdf (the last paint form xobject is empty: .../Fm6 Do Q 
endstream endobj). No errors or warnings in the ConTeXt log (actual? 
beta). The same code works with mkii. No minimal example yet.


\nopdfcompression

and then look in the pdf file to see if there's something weird in XForm  6


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib logging

2009-05-13 Thread Peter Rolf

Hans Hagen schrieb:

Peter Rolf wrote:

Hi,

how do I enable (verbose) logging of mplib? I have problems with a 
corrupt pdf (the last paint form xobject is empty: .../Fm6 Do Q 
endstream endobj). No errors or warnings in the ConTeXt log (actual? 
beta). The same code works with mkii. No minimal example yet.


\nopdfcompression

and then look in the pdf file to see if there's something weird in 
XForm  6


ah, looks like my pdf/ps code understanding is not good enough. do you 
mean the xobject declaring 'mps graphic 6'?
i haven't found much information for the \Fm pattern, so i don't know 
how to connect the resources...





-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___ 

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___ 





___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Mplib problem of latest beta on luatex 0.40

2009-04-26 Thread Longmin Wang
On Mon, Apr 27, 2009 at 08:33:04AM +0800, Wei-Wei Guo wrote:
Dear developers,

Here is the example and warnings.

The compiled result has no underline and ConTeXt complains during compilation:

 mplib   : making 'metafun.mp' into 
'/var/cache/texmf/luatex-cache/context/b51cb04348b3b14d1dfc7333fc9b63f2/formats/cont-en-metafun.mem'
 mplib   : problems with 'metafun.mp' from 
'/var/cache/texmf/luatex-cache/context/b51cb04348b3b14d1dfc7333fc9b63f2/formats/cont-en-metafun.mem'

It works fine here with the latest beta and luatex 0.40. You may try
to delete luatex-cache and regenerate it. 

-- 
Longmin Wang longminw...@gmail.com
Math. Dept., Nankai Univ., China
http://math.nankai.edu.cn/~wanglm/
GnuPG-Key ID: 1024D/2A5CFA5C
Fingerprint: 8587 1246 3AAD C185 D419  ADF1 B620 D8B8 2A5C FA5C
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Mplib problem of latest beta on luatex 0.40

2009-04-26 Thread Wei-Wei Guo

Longmin Wang 写道:

Hi Longmin,


It works fine here with the latest beta and luatex 0.40. You may try
to delete luatex-cache and regenerate it. 



It solves the problem, thanks.

I find another problem with the example in my previous email. I changed the
example a little bit.

Example:

\startuseMPgraphic{mpos:par:columnset:textuline}
  \iftracepositions show_multi_pars \else draw_multi_pars \fi ;
  path p ; p := boundingbox currentpicture ;
  currentpicture := currentpicture shifted (0,0.3*StrutDepth) ;
  setbounds currentpicture to p ;
\stopuseMPgraphic

\definetextbackground
  [underline]
  [location=text,
   alternative=1,
   mp=mpos:par:columnset:textuline,
   background=,
   frame=off]

\starttext

\underline{blurblur}

\underline{blurblur}

\underline{blurblur}

\underline{blurblur}

\stoptext

The vertical positions of underlines are not stable. See the attached PDF file.


Best wishes,
Wei-Wei


test.pdf
Description: Adobe PDF document
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-10-01 Thread Taco Hoekwater


Hi Olivier,

Olivier wrote:

Btw: could you add in the doc a simple example of how to set up an mplib 
instance
(loading the format file) and typesetting a minimal graphic, and then
use it from within plain TeX for instance; this is transparent to
conTeXt users since there are files like mlib-run.lua but not easy for
plain TeX users :P  


Running mplib is easy enough to document, but that is only a part of
the work: you also have to convert the image to pdf literals, and
that is more work than I would like to put in the manual. Anyway, 
attached is a bunch of definitions I stripped out of context that

will allow you to run mplib in plain tex provided that you also have
context installed (you need mlib-pdf.lua for the PDF conversion)

Best wishes,
Taco

metapost = (metapost or {})

function metapost.report (a)
   print (\n .. a)
end

function metapost.finder (name, mode, ftype)
   return (mode==w and  name) or kpse.find_file(name, ftype)
end

function metapost.make(name, target, finder)
   local status = 2 -- higher numbers are errors
   finder = (finder or metapost.finder)
   local mpx = mplib.new ( {
 hash_size = 10,
 main_memory = 200,
 max_in_open = 50,
 param_size = 10,
 ini_version = true,
 find_file = finder,
 job_name = target,
  } )
   if mpx then
  local result = mpx:execute(input  .. name .. ; dump;)
  if result then status = result.status end
  mpx:finish()
   end
   if status  2 then
  metapost.report('mp message: created mem file ' .. target )
   else 
  metapost.report('mp error: mem file generation failed')
   end
end

function metapost.load(name, finder)
   finder = (finder or metapost.finder)
   local memname = finder(mplib- .. name,r,mem)
   if not memname then
  memname = finder(mplib- .. name, w, mem)
  metapost.make(name, memname, finder)
   end
   metapost.report('mp message: using mem file ' .. memname)
   local mpx = mplib.new ( {
 ini_version = false,
 mem_name = memname,
 find_file = finder,
  } )
   if not mpx then
  metapost.report('mp error: mem loading failed')
   end
   return mpx
end

function metapost.process(mpx, data)
local result
if mpx and data then
result = mpx:execute(data)
-- todo: error message
if not result then
   metapost.report(mp error: no result object returned)
elseif result.status  0 then
   metapost.report(mp error: .. (result.term or no-term) .. \n .. 
(result.error or no-error))
end
 end
 return result
end


\pdfoutput = 1
\pdfcompresslevel=0

\directlua0{ dofile (mplib.lua) }
\directlua0{ dofile (kpse.find_file('mlib-pdf.lua')) }

% some things that are normally pre-defined in context

\newdimen\onebasepoint 
\onebasepoint = 1bp
\newbox\scratchbox
{\catcode`\% =12 \gdef\letterpercent{%}}
\directlua0{ tex.ctxcatcodes = 0 }

% the three macros output by the context converter:

\def\startMPLIBtoPDF#1#2#3#4% watch the transparency reset
  {\hbox\bgroup
   \xdef\MPllx{#1}%
   \xdef\MPlly{#2}%
   \xdef\MPurx{#3}%
   \xdef\MPury{#4}%
   \xdef\MPwidth {\the\dimexpr#3\onebasepoint-#1\onebasepoint\relax}%
   \xdef\MPheight{\the\dimexpr#4\onebasepoint-#2\onebasepoint\relax}%
   \setbox\scratchbox\vbox\bgroup
   \noindent % this is really needed in order to force tex into proper cm's
}

\let\MPLIBtoPDF\pdfliteral

\def\stopMPLIBtoPDF % watch the transparency reset
  {\egroup
   \setbox\scratchbox\hbox\bgroup
 \hskip-\MPllx\onebasepoint
 \raise-\MPlly\onebasepoint
 \box\scratchbox
   \egroup
   \setbox\scratchbox\vbox to \MPheight\bgroup
 \vfill
 \hsize\MPwidth
 \ht\scratchbox=0pt
 \dp\scratchbox=0pt
 \box\scratchbox
   \egroup
   \wd\scratchbox\MPwidth
   \ht\scratchbox\MPheight
   \box\scratchbox
   \egroup }

% our own command

\def\mp#1{\directlua0{ 
  if not mpx then mpx = metapost.load('plain') end
  local f = metapost.process(mpx,'#1')
  if f then
print (f.term)
if f.fig then
  metapost.convert(f)
end
  end
}}

\mp{beginfig(1); draw fullcircle scaled 20 withcolor (1,0,0); endfig;}

\bye___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-10-01 Thread Olivier
Hi Taco,

 Running mplib is easy enough to document, but that is only a part of
 the work: you also have to convert the image to pdf literals, and
 that is more work than I would like to put in the manual. 

OK. It could be nice then to simply state this?

 Anyway, attached is a bunch of definitions I stripped out of context
 that will allow you to run mplib in plain tex provided that you also
 have context installed (you need mlib-pdf.lua for the PDF conversion)

Thanks a lot for these. With these hints I am now able to compile
metapost figs from conTeXt through texexec --luatex normaly.
To this end, I had to perform two tweaks:

* the files mlib-run.lua, mlib-ctx.lua, and mlib-pdf.lua were *NEVER*
  loaded so I added to my conTeXt source file:
  \directlua0 { dofile
  (/usr/share/texmf/tex/context/base/mlib-ctx.lua) }
  \directlua0 { dofile
  (/usr/share/texmf/tex/context/base/mlib-run.lua) }
  \directlua0 { dofile
  (/usr/share/texmf/tex/context/base/mlib-pdf.lua) }

* the format was generated correctly but loaded incorrectly:
  I had to add the following line:
   ini_version = false,
  in the metapost.load function in the mlib-run.lua file.

Now everything is OK.  The second thing (an misfortunate typo) is easy
to fix.  However, the fact that mlib-*.lua are never loaded is more worrying:
any idea where this error comes from?

Hope this will help Hans as well.

Cheers,
Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-10-01 Thread Taco Hoekwater

Hi Olivier and Hans,

Olivier wrote:
 
 Thanks a lot for these. With these hints I am now able to compile
 metapost figs from conTeXt through texexec --luatex normaly.
 To this end, I had to perform two tweaks:
 
 * the files mlib-run.lua, mlib-ctx.lua, and mlib-pdf.lua were *NEVER*
   loaded so I added to my conTeXt source file:
   \directlua0 { dofile
   (/usr/share/texmf/tex/context/base/mlib-ctx.lua) }
   \directlua0 { dofile
   (/usr/share/texmf/tex/context/base/mlib-run.lua) }
   \directlua0 { dofile
   (/usr/share/texmf/tex/context/base/mlib-pdf.lua) }

Wouldn't that mean that

   $ luatools mlib-pdf.lua

also fails to find the files? luatools --generate should be able to
fix that.

 * the format was generated correctly but loaded incorrectly:
   I had to add the following line:
ini_version = false,
   in the metapost.load function in the mlib-run.lua file.
 
 Now everything is OK.  The second thing (an misfortunate typo) is easy
 to fix.  

This should be fixable by simply updating your context, because that
is already fixed in newer contexts. But this could well be the cause
of Hans' problems.

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-10-01 Thread Olivier
Taco,

 Wouldn't that mean that
 
$ luatools mlib-pdf.lua
 
 also fails to find the files? luatools --generate should be able to
 fix that.

Indeed luatools mlib-pdf.lua fails to find the file.
However luatools --generate does not help.
I'll investigate why.

 This should be fixable by simply updating your context, because that
 is already fixed in newer contexts. But this could well be the cause
 of Hans' problems.

I would have think so :)

Best,
Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Taco Hoekwater


Hans van der Meer wrote:
 
 I think this proves the file in my case is indeed the 01-04-08 02:14  
 one.

A shame, really. If the file was wrong, there was a chance to catch the
bug. As it stands, I am still just as dumbfounded as I was before.

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Olivier
Hi Luigi,

 I found really easy to install minimals under ubuntu
 (just download first-setup.sh), so I can have one
 sandbox of mkiv+luatex stable and one for beta .
 Why don't you give it a try ?
 (don't forget to update to latest luatex)

I'm sure minimals are worth a try. But as I stated before, everything
but the mplib is working fine + I like the packaging of Norbert Preining
which is very well done and LuaTeX is getting updated very often + I
packaged for Debian a lot of conTeXt style files and font setups for people
in my group + using such official Debian packages gives them a chance to
be improved and debugged which will benefit other people...

Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread luigi scarso
On Tue, Sep 30, 2008 at 10:54 AM, Olivier [EMAIL PROTECTED] wrote:

 Hi Luigi,

  I found really easy to install minimals under ubuntu
  (just download first-setup.sh), so I can have one
  sandbox of mkiv+luatex stable and one for beta .
  Why don't you give it a try ?
  (don't forget to update to latest luatex)

 I'm sure minimals are worth a try. But as I stated before, everything
 but the mplib is working fine + I like the packaging of Norbert Preining
 which is very well done and LuaTeX is getting updated very often + I
 packaged for Debian a lot of conTeXt style files and font setups for people
 in my group + using such official Debian packages gives them a chance to
 be improved and debugged which will benefit other people...

All ok, I didn't meant that you must switch to minimals .

In Ubuntu I have put  minimals under /opt/luatex/minimals (and minimals-beta
in /opt/luatex/minimals-beta) .
They are unrelated with package system, texlive2007, texlive2008 and so on ;
also installing/updating minimals is easy (at least on ubuntu) apart luatex
version (but it's not really a problem) .
I run every tests under minimals and minimals-beta .
If they work, I assume minimals / minimals-beta are OK .
Your test works on my minimals, so (my) minimals are OK.
So if you install minimals /minimals-beta you can even say what is wrong in
your packaging
(if something is wrong: maybe you have mixed  files) .

I feel good with ubuntu, but for TeX related stuff I prefear manual
installation . I don't expect that anyone agree on this .
-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Ulrike Fischer
Am Mon, 29 Sep 2008 17:55:15 +0200 schrieb Olivier:


 mplib  : loading format: metafun.mp, name:
 /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
 mplib  : version mismatch: mp_parent_version  2008.05.21 15:21
 mplib  : making format: metafun.mp, name:
 /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem

 The format metafun.mp is not good at first, but seems to be regenerated
 dynamically with success ?  

Do you get still this regeneration message or has it disappeared? 
If not I would say the format generation was not successfull. 

-- 
Ulrike Fischer 

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Olivier
Hi Ulrike,

Quoting  Ulrike Fischer :
 -- was [EMAIL PROTECTED] on Sep 30, 2008 at 11:27:08 --

 Am Mon, 29 Sep 2008 17:55:15 +0200 schrieb Olivier:
 
 
  mplib  : loading format: metafun.mp, name:
  /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
  mplib  : version mismatch: mp_parent_version  2008.05.21 15:21
  mplib  : making format: metafun.mp, name:
  /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
 
  The format metafun.mp is not good at first, but seems to be regenerated
  dynamically with success ?  
 
 Do you get still this regeneration message or has it disappeared? 
 If not I would say the format generation was not successfull. 

Indeed, this format gets regenerated every time.
Is there a way to genereate it separatly?

Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Olivier
Hi Taco,

Quoting  Taco Hoekwater :
 -- was [EMAIL PROTECTED] on Sep 29, 2008 at 11:27:03 --

 Olivier wrote:
  
  What is the executable that is triggered by a call to mplib?
  (I would like to check I have it installed, not only mpost.)
 
 There isn't one, it is all internal to luatex's executable.
 
 There are no external executables and no config files involved,

So, I guess it would make sense to test the compiler directly:
what is the most basic way to trigger mplib from a plain tex file
directly run through LuaTeX (i.e. the equivalent of the startMPgraphic
if any? (And this might provide some more information on what's going on.)

Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Taco Hoekwater


Olivier wrote:
 
 So, I guess it would make sense to test the compiler directly:
 what is the most basic way to trigger mplib from a plain tex file
 directly run through LuaTeX (i.e. the equivalent of the startMPgraphic
 if any? (And this might provide some more information on what's going on.)

Just look at mlib-run.lua from the context distribution, it should
be clear enough.

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Ulrike Fischer
Am Tue, 30 Sep 2008 11:37:13 +0200 schrieb Olivier:

 Do you get still this regeneration message or has it disappeared? 
 If not I would say the format generation was not successfull. 
 
 Indeed, this format gets regenerated every time.
 Is there a way to genereate it separatly?

I don't know ;-(. I know up to nothing about context and metapost. But
both you and Hans get this regeneration of the formats so I suspect it
is the source of the problem. At least it is certainly not normal and
one should always start with the first error. 


-- 
Ulrike Fischer 

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Hans Hagen
Ulrike Fischer wrote:
 Am Tue, 30 Sep 2008 11:37:13 +0200 schrieb Olivier:
 
 Do you get still this regeneration message or has it disappeared? 
 If not I would say the format generation was not successfull. 
 Indeed, this format gets regenerated every time.
 Is there a way to genereate it separatly?
 
 I don't know ;-(. I know up to nothing about context and metapost. But
 both you and Hans get this regeneration of the formats so I suspect it
 is the source of the problem. At least it is certainly not normal and
 one should always start with the first error. 

a new cont-en-metafun.mem gets generated when

(1) it's not there
(2) the context version changed
(3) the metafun version changed

mkiv does not use the metafun.mem file

Hans


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Hans Hagen
Ulrike Fischer wrote:
 Am Mon, 29 Sep 2008 17:55:15 +0200 schrieb Olivier:
 
 
 mplib  : loading format: metafun.mp, name:
 /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
 mplib  : version mismatch: mp_parent_version  2008.05.21 15:21
 mplib  : making format: metafun.mp, name:
 /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/formats/cont-en-metafun.mem
 
 The format metafun.mp is not good at first, but seems to be regenerated
 dynamically with success ?  
 
 Do you get still this regeneration message or has it disappeared? 
 If not I would say the format generation was not successfull. 

maybe a mismatch between the binary and context (maybe the log file in 
the cache formats paths tells more)

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-30 Thread Olivier
Taco,

  So, I guess it would make sense to test the compiler directly:
  what is the most basic way to trigger mplib from a plain tex file
  directly run through LuaTeX (i.e. the equivalent of the startMPgraphic
  if any? (And this might provide some more information on what's going on.)
 
 Just look at mlib-run.lua from the context distribution, it should
 be clear enough.

Thanks for the pointer.  I played a bit with pdfluatex directly which
seems to work. (I'm not to the point of producing figures, because I
would have to rebuild all the functions that are located in mlib-run.lua
and the luatexref-t.tex does not give straightforward example of how the
mplib module should be used, it only describes the functions API. Btw:
could you add in the doc a simple example of how to set up an mplib instance
(loading the format file) and typesetting a minimal graphic, and then
use it from within plain TeX for instance; this is transparent to
conTeXt users since there are files like mlib-run.lua but not easy for
plain TeX users :P  And I'm not advocating the use of plain TeX,
I'm a converted conTeXt user since 2003, but this will help user
understand (a bit) how things work behind the scene.) 

Thanks for your (and all the posters') interest,
Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread luigi scarso
On Mon, Sep 29, 2008 at 5:55 PM, Olivier [EMAIL PROTECTED] wrote:

 Dear all,

 I'm using ConTeXt MkIV on Debian with the following version:

 ConTeXt  ver: 2008.05.21 15:21 MKIV  fmt: 2008.8.4  int: english/english

 Everything seems to work well (I am able to run lua code, use otf font
 facilities, etc...) but the mplib mechanism.  Indeed, running through
 the following simple file :

 \starttext
 \startMPcode
  path p ; p := fullcircle scaled 4cm ;
  fill p  withcolor red ;
  fill p shifted(2cm,0cm) withcolor blue ;
 \stopMPcode
 \stoptext

I have prepended
\setupcolors[state=start]

BTW, no problems with
MtxRun | current version: 2008.08.05 18:47
This is LuaTeX, Version snapshot-0.29.0-2008071816

and  with beta
MtxRun | current version: 2008.09.24 18:41
This is LuaTeX, Version snapshot-0.29.0-2008071816




-- 
luigi
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread Olivier
Hi Luigi,

  \starttext
  \startMPcode
   path p ; p := fullcircle scaled 4cm ;
   fill p  withcolor red ;
   fill p shifted(2cm,0cm) withcolor blue ;
  \stopMPcode
  \stoptext
 
 I have prepended
 \setupcolors[state=start]

This is indeed required to get the color but my problem is that the
graphic do not get typeset at all!  As can be seen from the log file 

report  mp terminal:
(/usr/share/texmf/metapost/context/base/mp-tool.mp
! Missing `=' has been inserted.
to be read again 
,
l.51 vardef mpversioncmp(expr s,
c) =
! Missing `=' has been inserted.
to be read again 
)
[...a long list of such errors omitted...]

there is an issue with loading mp-tool.mp
Could it be that something related to mplib is not package in Norbert
Preining's packages?  Is there a particular file that I should look for? 

 BTW, no problems with
 MtxRun | current version: 2008.08.05 18:47
 This is LuaTeX, Version snapshot-0.29.0-2008071816
 
 and  with beta
 MtxRun | current version: 2008.09.24 18:41
 This is LuaTeX, Version snapshot-0.29.0-2008071816

Thanks for the information,
Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread Hans van der Meer
Olivier: What system do you use? I am using MacOSX and in july this  
year I mailed about the error below:

 mplib  : making format: metafun.mp, name: /Users/hans/TeX/ 
 luatex-cache/context/60e9a4b67d8fc84c21043806bb9e2fb8/formats/cont- 
 en-metafun.mem
 mplib  : loading format: metafun.mp, name: /Users/hans/TeX/ 
 luatex-cache/context/60e9a4b67d8fc84c21043806bb9e2fb8/formats/cont- 
 en-metafun.mem
 report  mp terminal: (/usr/local/texlive/2007/texmf-context/ 
 metapost/context/base/mp-tool.mp
 ! Missing `=' has been inserted.
 to be read again
   ,
 l.51 vardef mpversioncmp(expr s,
 c) =
 ! Missing `=' has been inserted.
 to be read again
   )
 l.55 vardef mpversionlt (expr s)

Sounds familiar? If you are also working on MacOSX(10.5.x) then I  
should expect the problem to be platform specific. I had some  
discussions with Taco Hoekwater about this problem, but we never  
solved it and I have no inkling of its cause. Since I am not well  
enough acquainted with the code behind mplib and friends, I had to  
fall back on using MKII and putting MKIV aside.
But I guess the solution to this problem is pressing, since we cannot  
have one platform falling out on ConTeXt.

Hans van der Meer




On 29 sep 2008, at 17:55, Olivier wrote:

 Dear all,

 I'm using ConTeXt MkIV on Debian with the following version:

 ConTeXt  ver: 2008.05.21 15:21 MKIV  fmt: 2008.8.4  int: english/ 
 english

 Everything seems to work well (I am able to run lua code, use otf font
 facilities, etc...) but the mplib mechanism.  Indeed, running through
 the following simple file :

 \starttext
 \startMPcode
  path p ; p := fullcircle scaled 4cm ;
  fill p  withcolor red ;
  fill p shifted(2cm,0cm) withcolor blue ;
 \stopMPcode
 \stoptext

 provokes the following logging :

 mplib  : loading format: metafun.mp, name:
 /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/ 
 formats/cont-en-metafun.mem
 mplib  : version mismatch: mp_parent_version  2008.05.21  
 15:21
 mplib  : making format: metafun.mp, name:
 /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/ 
 formats/cont-en-metafun.mem
 mplib  : loading format: metafun.mp, name:
 /home/olivier/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/ 
 formats/cont-en-metafun.mem
 report  mp terminal:
 (/usr/share/texmf/metapost/context/base/mp-tool.mp
 ! Missing `=' has been inserted.
 to be read again
   ,
 l.51 vardef mpversioncmp(expr s,
 c) =
 etc...

 The format metafun.mp is not good at first, but seems to be  
 regenerated
 dynamically with success ?

 Is this a known issue ? Any hints on what's going on ?

 Olivier
 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread Taco Hoekwater


Hi,

To both of you:

Hans van der Meer wrote:

 /usr/local/texlive/2007/texmf-context/metapost/context/base/mp-tool.mp

Olivier wrote:

 /usr/share/texmf/metapost/context/base/mp-tool.mp

Can you guys check if these are the correct versions of mp-tool.mp ?
The problem could be as basal as mp finding older versions of the
metafun files (from before the mkiv support).


Best wishes,
Taco
(who assumes Olivier is on intel/amd, not powerpc)

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread Olivier
Hi Taco,

 Hans van der Meer wrote:
 
  /usr/local/texlive/2007/texmf-context/metapost/context/base/mp-tool.mp
 
 Olivier wrote:
 
  /usr/share/texmf/metapost/context/base/mp-tool.mp
 
 Can you guys check if these are the correct versions of mp-tool.mp ?
 The problem could be as basal as mp finding older versions of the
 metafun files (from before the mkiv support).

My mp-tool.mp file is the same as 

http://minimals.contextgarden.net/current/context/latest/metapost/context/base/mp-tool.mp

that is contains 
if not known mpversion : string mpversion ; mpversion := 0.641 ; fi ;
and
%Dversion=1998.02.15,


 (who assumes Olivier is on intel/amd, not powerpc)

I'm indeed working on a Debian system with intel plateform.
(But Hans' config is not that different : some sort of Unix with TeXlive
distrib.) The texlive packages I'm using are those of Norbert Preining,
last version. 

What is the executable that is triggered by a call to mplib?
(I would like to check I have it installed, not only mpost.)
Again, everything else in conTeXt works well (otf direct from file
names, lua scripting, etc).

Olivier
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread Taco Hoekwater
Olivier wrote:
 
 What is the executable that is triggered by a call to mplib?
 (I would like to check I have it installed, not only mpost.)

There isn't one, it is all internal to luatex's executable.

There are no external executables and no config files involved,
and that is what makes these errors so weird (well, that and
the fact that it only seems to happen to Hans and you).

Confused,
Taco



___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread luigi scarso
On Mon, Sep 29, 2008 at 9:44 PM, Olivier [EMAIL PROTECTED] wrote:

 Hi Luigi,

   \starttext
   \startMPcode
path p ; p := fullcircle scaled 4cm ;
fill p  withcolor red ;
fill p shifted(2cm,0cm) withcolor blue ;
   \stopMPcode
   \stoptext
  
  I have prepended
  \setupcolors[state=start]

 This is indeed required to get the color

 yes, I didn't like greys circles...

 but my problem is that the
 graphic do not get typeset at all!  As can be seen from the log file

Just to be sure, in attachment my pdf
I found really easy to install minimals under ubuntu (just download
first-setup.sh), so I can have one
sandbox of mkiv+luatex stable and one for beta .
Why don't you give it a try ?
(don't forget to update to latest luatex)

-- 
luigi


test-oliver.pdf
Description: Adobe PDF document
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib errors

2008-09-29 Thread Hans van der Meer
Hi Taco,

I did kpsewhich mp-tool.mp and it came up with /usr/local/texlive/ 
2007/texmf-context/metapost/context/base/mp-tool.mp. That file has in  
my system creation+modification date 01-04-08 02:14 and was last  
opened 03-07-08 so this must be it. Came straight from unpacking the  
context distribution zip. This should have been cont-tmf.zip created  
05-08-08 17:13.

The other mp-tool.mp in my system is /usr/local/texlive/2007/texmf- 
dist/metapost/context/base/mp-tool.mp. I also checked this one and  
found it has creation+modification date 06-02-08 12:52 and was last  
opened 06-02-08 12:52. So this one was apparently never used by me  
after installing texlive2007.

I think this proves the file in my case is indeed the 01-04-08 02:14  
one.

Hans van der Meer




On 29 sep 2008, at 22:10, Taco Hoekwater wrote:



 Hi,

 To both of you:

 Hans van der Meer wrote:

 /usr/local/texlive/2007/texmf-context/metapost/context/base/mp- 
 tool.mp

 Olivier wrote:

 /usr/share/texmf/metapost/context/base/mp-tool.mp

 Can you guys check if these are the correct versions of mp-tool.mp ?
 The problem could be as basal as mp finding older versions of the
 metafun files (from before the mkiv support).


 Best wishes,
 Taco
 (who assumes Olivier is on intel/amd, not powerpc)

 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib problems

2008-07-07 Thread Peter Rolf
Hans Hagen schrieb:
 Peter Rolf wrote:
 hi,

 does this error message ring a bell? same problem with luatex 0.27 and 
 0.28 using the latest beta. mkii works ok.
 
 hm, what graphic?


% engine=luatex

\startuniqueMPgraphic{foo}
draw unitsquare xyscaled(3cm,3cm)
withcolor transparent(1,.5,red);
\stopuniqueMPgraphic


\starttext

\null
\uniqueMPgraphic{foo}

\stoptext

 -
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
   | www.pragma-pod.nl
 -
 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 ___
 

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib problems

2008-07-03 Thread Peter Rolf
Peter Rolf schrieb:
 hi,
 
 does this error message ring a bell? same problem with luatex 0.27 and 
 0.28 using the latest beta. mkii works ok.
 
 [..]
 ! LuaTeX error r:/tex/texmf-context/tex/context/base/mlib-pdf.lua:92: 
 bad argument #-1 to 'pen_info' (MPlib.gr expected, got table)
 stack traceback:
   [C]: in function 'pen_info'
   r:/tex/texmf-context/tex/context/base/mlib-pdf.lua:92: in function 
 'pen_characteristics'
   r:/tex/texmf-context/tex/context/base/mlib-pdf.lua:296: in function 
 'flush'
   r:/tex/texmf-context/tex/context/base/mlib-pdf.lua:45: in function 
 'convert'
   r:/tex/texmf-context/tex/context/base/mlib-run.lua:255: in function 
 'process'
   r:/tex/texmf-context/tex/context/base/mlib-pps.lua:719: in function 
 'graphic_base_pass'
   r:/tex/texmf-context/tex/context/base/mlib-ctx.lua:19: in function 
 'graphic'
   main ctx instance:1: in main chunk.
 \processMPgraphic ...alizations ;#1;\!!es ,  ) }
\else \ctxlua { 
 metapost.g...
 \handleuniqueMPgraphic ... {\processMPgraphic {#3}
}\setxvalue {\@@MPG 
 \overl...
 \douniqueMPgraphic ...#1][#2]\getvalue {\@@MPG #1}
\empty \elabelgroup
 \executedefinedoverlay ...x {\the \everyoverlay #2
}}\setbox \scratchbox 
 \hbo...
 \next4 ...d {\??ov \currentbackground }\donothing
}}}\wd \extraframebox 
 \zer...
 \rawprocesscommaitem ...commalevel \endcsname {#1}
\expandafter 
 \rawprocessco...
 ...
 [..]
 
 
 i also have some problems with endless loops here. luatex (=0.27) runs 
 wild, comsuming one cpu and memory; no error messages or logging. as i 
 have currently no time, i simply switched back to an older version. 
 0.25.3 works ok, but has a problem with drawing small line widths (seems 
 to be fixed in 0.28).

the trunk version seems to have fixed that problem. *thanks Taco!!*
but the 'pen_info' error still occurs at two of my examples.

regards, peter
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib problems

2008-07-02 Thread Hans Hagen
Peter Rolf wrote:
 hi,
 
 does this error message ring a bell? same problem with luatex 0.27 and 
 0.28 using the latest beta. mkii works ok.

hm, what graphic?

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Hans Hagen
Thomas A. Schmitz wrote:
 Hi Hans and Taco,
 
 it looks like mplib is broken in the latest beta. Simple file:

indeed, we're experimenting with a couple of nasty bugs and in the 
process mess aroudn with beta's; sorry ...

i'll upload a new one (new bins later)

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Thomas A. Schmitz

On May 28, 2008, at 4:33 PM, Hans Hagen wrote:

 indeed, we're experimenting with a couple of nasty bugs and in the
 process mess aroudn with beta's; sorry ...

 i'll upload a new one (new bins later)

 Hans

Hi Hans,

new beta does indeed produce output, but every MP graphic is centered  
(which doesn't look too good with my presentation backgrounds :-)

All best

Thomas
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Hans Hagen
Thomas A. Schmitz wrote:
 On May 28, 2008, at 4:33 PM, Hans Hagen wrote:
 
 indeed, we're experimenting with a couple of nasty bugs and in the
 process mess aroudn with beta's; sorry ...

 i'll upload a new one (new bins later)

 Hans
 
 Hi Hans,
 
 new beta does indeed produce output, but every MP graphic is centered  
 (which doesn't look too good with my presentation backgrounds :-)

hm i wonder why ... maybe you use raggedcenter?

Hans


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib/metafun broken in latest beta

2008-05-28 Thread Thomas A. Schmitz

On May 28, 2008, at 11:41 PM, Hans Hagen wrote:

 hm i wonder why ... maybe you use raggedcenter?

 Hans

Just try the minimal example I sent this afternoon and compile it with  
mkii and mkiv and you'll see the difference.

Thomas
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-23 Thread Wolfgang Werners-Lucchini
Hallo Taco et al
  \startlua
  local function finder(name, mode, ftype)
   if mode==w then
   return name
   else
   return kpse.find_file(name,ftype)
   end
  end
  
  Jein!
  
 
 Try this, a little more elaborate, version of finder:
 
local function finder(name, mode, ftype)
local found
if mode==w then
   found = name
else
   found = kpse.find_file(name,ftype)
end
print(MPlib finder:  .. name ..  -  .. found)
return found
end
 
 maybe that will give a clue.

Example 1: my test file with your finder.
--
MPlib finder: mpost.mp - d:/context/tex/texmf/metapost/base/mpost.mp
MPlib finder: mpost.map - 
MPlib finder: plain.mp - d:/context/tex/texmf/metapost/base/plain.mp
t={
 [log]=This is MetaPost, Version 1.003 (INIMP)  23 APR 2008 07:51 
(mpost.mp(plain.mp\
Preloading the plain mem file, version 0.99),
 [status]=0,
 [term]=This is MetaPost, Version 1.003 (Cweb version 0.40) 
(INIMP)\
 (mpost.mp(plain.mp\
Preloading the plain mem file, version 0.99),
}
MPlib finder: mpost.mem - 
t={
 [log]= )\
Beginning to dump on file mpost.mem\
 (mem=mpost 8.4.23)\
at most 736 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
,
 [status]=0,
 [term]= )\
Beginning to dump on file mpost.mem\
 (mem=mpost 8.4.23)\
at most 736 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
Transcript written on mpost.log.\
,
}
--
found = 
no mpost.mem, no mpost.log

Example 2: my test file with your finder and (wb not w)
--
MPlib finder: mpost.mp - d:/context/tex/texmf/metapost/base/mpost.mp
MPlib finder: mpost.map - 
MPlib finder: plain.mp - d:/context/tex/texmf/metapost/base/plain.mp
t={
 [log]=This is MetaPost, Version 1.003 (INIMP)  23 APR 2008 07:58 
(mpost.mp(plain.mp\
Preloading the plain mem file, version 0.99),
 [status]=0,
 [term]=This is MetaPost, Version 1.003 (Cweb version 0.40) 
(INIMP)\
 (mpost.mp(plain.mp\
Preloading the plain mem file, version 0.99),
}
MPlib finder: mpost.mem - mpost.mem
t={
 [log]= )\
Beginning to dump on file mpost.mem\
 (mem=mpost 8.4.23)\
at most 736 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
,
 [status]=0,
 [term]= )\
Beginning to dump on file mpost.mem\
 (mem=mpost 8.4.23)\
at most 736 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
Transcript written on mpost.log.\
,
}
--
mpost.mem gets written now
but no mpost.log

grusz Wolfgang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-23 Thread Taco Hoekwater

Hi,

Wolfgang Werners-Lucchini wrote:
 
 Example 1: my test file with your finder.
 --
 MPlib finder: mpost.mem - 

So it was running the kpse.find_file instead of returning a local name,
and it is not found. There is a silent error here that I should make
explicit, but the real problem (as Akira noted) is that it was in
the else branch at all.

 Example 2: my test file with your finder and (wb not w)
 --
 MPlib finder: mpost.mem - mpost.mem

That is correct, here it will write to the local file mpost.mem

 mpost.mem gets written now but no mpost.log

I can remove that line, it is misleading. The content of the
log file is in result.log

Best wishes,
Taco


___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-23 Thread Wolfgang Werners-Lucchini
Hi Taco,

 I can remove that line, it is misleading. The content of the
 log file is in result.log

What do you mean with result?

There is only ONE log file and that is tst10.log (the log file of the 
tst10.tex which runs the above code).

Wolfgang

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-23 Thread Taco Hoekwater


Wolfgang Werners-Lucchini wrote:
 Hi Taco,
 
 I can remove that line, it is misleading. The content of the
 log file is in result.log
 
 What do you mean with result?

The res.log entry in the lua result table.
I had forgotten the variable name.

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-19 Thread Taco Hoekwater
Wolfgang Werners-Lucchini wrote:
 Hallo Taco,
 
 Everything I read below says there should be a 'plain.mem'
 in the folder where you ran theat file in.  If there
 really really isn't, then my only advise to you is to buy
 a less thieving operating system, as it seems this one steals
 your files before you can even have an admiring look at them.
 :-)
 
 May be you are right that operating system steals files. We should do 
 something against that.
 
 Lutz Haseloff has send me his test (he too sees no 'mpost.mem'):

When Hans and I tested this, it worked just fine. Does the high-level
context interface work for you at all, btw? I have no idea what is
going on, and I cannot test myself, so I am even more lost than you
are. MPlib firmly believes it has written a file:

   Beginning to dump on file mpost.mem
   (mem=mpost 8.4.18)
   at most 736 strings of total length 3629
   3326 memory locations dumped; current usage is 10212227
   501 symbolic tokens

There is nothing more I myself can do about it.

Best wishes,
Taco




___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-19 Thread Wolfgang Werners-Lucchini
On 19 Apr 2008 at 8:58, [EMAIL PROTECTED] wrote:

  Everything I read below says there should be a 'plain.mem'
  in the folder where you ran theat file in.  If there
  really really isn't, then my only advise to you is to buy
  a less thieving operating system, as it seems this one steals
  your files before you can even have an admiring look at them.
  :-)
  
  May be you are right that operating system steals files. We should
 do 
  something against that.
  
  Lutz Haseloff has send me his test (he too sees no 'mpost.mem'):
 
Hallo Taco,

 When Hans and I tested this, it worked just fine.

Have you tested exactly my example on a windows minimal?

 Does the high-level
 context interface work for you at all, btw? 

The high-level interface seems to work.

 I have no idea what is
 going on, and I cannot test myself, so I am even more lost than
 you are. MPlib firmly believes it has written a file:
 
Beginning to dump on file mpost.mem
(mem=mpost 8.4.18)
at most 736 strings of total length 3629
3326 memory locations dumped; current usage is 10212227
501 symbolic tokens
 

Yes, I know this.

 There is nothing more I myself can do about it.

Do you use a sort of io-buffering in the mplib or a memory-file?
When is the file flushed or closed?

Wolfgang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-19 Thread Wolfgang Werners-Lucchini
  \startlua
  local function finder(name, mode, ftype)
   if mode==w then
   return name
   else
   return kpse.find_file(name,ftype)
   end
  end

Jein!

The only file in my tex tree which could play that roule is

cont-en-mpost.mem

in the cache

\tex\texmf-cache\luatex-
cache\context\c80dc1fd5292ec817c6e82c295beaf1e\formats

this file causes from a metapost:process run
and is not overwritten by my example.

So, there is not written any mpost.mem in the whole tree.

Gruß, Wolfgang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-19 Thread Hans Hagen
Wolfgang Werners-Lucchini wrote:
 \startlua
 local function finder(name, mode, ftype)
  if mode==w then
  return name
  else
  return kpse.find_file(name,ftype)
  end
 end
 
 Jein!
 
 The only file in my tex tree which could play that roule is
 
 cont-en-mpost.mem
 
 in the cache
 
 \tex\texmf-cache\luatex-
 cache\context\c80dc1fd5292ec817c6e82c295beaf1e\formats
 
 this file causes from a metapost:process run
 and is not overwritten by my example.
 
 So, there is not written any mpost.mem in the whole tree.

mkiv adds cont-en infront of the format name, in order to avoid clashes, 
also formats are only created once

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-19 Thread Taco Hoekwater
Wolfgang Werners-Lucchini wrote:
 \startlua
 local function finder(name, mode, ftype)
  if mode==w then
  return name
  else
  return kpse.find_file(name,ftype)
  end
 end
 
 Jein!
 

Try this, a little more elaborate, version of finder:

   local function finder(name, mode, ftype)
   local found
   if mode==w then
  found = name
   else
  found = kpse.find_file(name,ftype)
   end
   print(MPlib finder:  .. name ..  -  .. found)
   return found
   end

maybe that will give a clue.

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-18 Thread Wolfgang Werners-Lucchini
Hallo Taco,

  Everything I read below says there should be a 'plain.mem'
  in the folder where you ran theat file in.  If there
  really really isn't, then my only advise to you is to buy
  a less thieving operating system, as it seems this one steals
  your files before you can even have an admiring look at them.
 :-)

May be you are right that operating system steals files. We should do 
something against that.

Lutz Haseloff has send me his test (he too sees no 'mpost.mem'):

TeXExec | processing document 'mplibtest.tex'
TeXExec | no ctx file found
TeXExec | tex processing method: context
TeXExec | TeX run 1
TeXExec | writing option file mplibtest.top
TeXExec | using randomseed 256
TeXExec | tex engine: luatex
TeXExec | tex format: cont-en
(./mplibtest.tex

ConTeXt  ver: 2008.04.16 17:34 MKIV  fmt: 2008.4.18  int: 
english/english

language   : language en is active
system : cont-new loaded
(C:/tex/texmf-context/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
(C:/tex/texmf-context/tex/context/base/cont-new.mkiv
lua: used config path - C:/tex/texmf-
local/web2c/texmf.cnf;C:/tex/texmf-
context/web2c/texmf.cnf;C:/tex/texmf/web2c/texmf.cnf
lua: used cache path - C:/tex/texmf-cache/luatex-
cache/context/71ddae2d1527093aac63e0e1aa139641
) (C:/tex/texmf-context/tex/context/base/cont-mtx.tex))
system : cont-old loaded
(C:/tex/texmf-context/tex/context/base/cont-old.tex
loading: Context Old Macros
)
system : cont-fil loaded
(C:/tex/texmf-context/tex/context/base/cont-fil.tex
loading: Context File Synonyms
)
system : cont-sys loaded
(C:/tex/texmf-local/tex/context/user/cont-sys.tex (C:/tex/texmf-
context/tex/context/base/type-tmf.tex) (C:/tex/texmf-
context/tex/context/base/type-siz.tex) (C:/tex/texmf-
context/tex/context/base/type-otf.tex))
bodyfont   : 12pt rm is loaded
specials   : tex loaded
system : mplibtest.top loaded
(./mplibtest.top
specials   : loading definition file tpd
(C:/tex/texmf-context/tex/context/base/spec-tpd.tex
specials   : loading definition file fdf
(C:/tex/texmf-context/tex/context/base/spec-fdf.tex (C:/tex/texmf-
context/tex/context/base/spec-fdf.mkiv))
specials   : fdf loaded
)
specials   : fdf loaded
) (./mplibtest.tuo) (./mplibtest.tuo)
systems: begin file mplibtest at line 2
t={
 [log]=This is MetaPost, Version 1.003 (INIMP)  18 APR 2008 06:34 
(mpost.mp(plain.mp\
Preloading the plain mem file, version 0.99),
 [status]=0,
 [term]=This is MetaPost, Version 1.003 (Cweb version 0.40) 
(INIMP)\
 (mpost.mp(plain.mp\
Preloading the plain mem file, version 0.99),
}
nothing
t={
 [log]= )\
Beginning to dump on file mpost.mem\
 (mem=mpost 8.4.18)\
at most 736 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
,
 [status]=0,
 [term]= )\
Beginning to dump on file mpost.mem\
 (mem=mpost 8.4.18)\
at most 736 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
Transcript written on mpost.log.\
,
}
nothing
fonts  : resetting map file list
{C:/tex/texmf-context/fonts/map/pdftex/context/original-empty.map}
fonts  : using map file: original-base
{C:/tex/texmf-context/fonts/map/pdftex/context/original-base.map}
fonts  : using map file: lm-math
{C:/tex/texmf/fonts/map/dvips/lm/lm-math.map}
fonts  : using map file: lm-rm
{C:/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts  : using map file: original-ams-base
{C:/tex/texmf-context/fonts/map/pdftex/context/original-ams-base.map}
fonts  : using map file: original-ams-euler
{C:/tex/texmf-context/fonts/map/pdftex/context/original-ams-
euler.map}
fonts  : using map file: original-public-lm
{C:/tex/texmf-context/fonts/map/pdftex/context/original-public-
lm.map} [1.1]
systems: end file mplibtest at line 38
 )C:/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf
mkiv lua stats : used config path  - C:/tex/texmf-
local/web2c/texmf.cnf;C:/tex/texmf-
context/web2c/texmf.cnf;C:/tex/texmf/web2c/texmf.cnf
mkiv lua stats : used cache path   - C:/tex/texmf-
cache/luatex-cache/context/71ddae2d1527093aac63e0e1aa139641
mkiv lua stats : modules/dumps/instances   - 84/20/1
mkiv lua stats : input load time   - 0.031 seconds
mkiv lua stats : fonts load time   - 1.063 seconds
mkiv lua stats : xml load time - 0.000 seconds, 
backreferences: 0, outer filtering time: 0.000
mkiv lua stats : mps conversion time   - 0.000 seconds
mkiv lua stats : node processing time  - 0.000 seconds (including 
kernel)
mkiv lua stats : kernel processing time- 0.000 seconds
mkiv lua stats : attribute processing time - 0.016 seconds
mkiv lua stats : language load time- 0.031 seconds, n=2
mkiv lua stats : graphics processing time  - 0.000 seconds, n=0 
(including tex)

Re: [NTG-context] mplib

2008-04-16 Thread Wolfgang Werners-Lucchini
On 16 Apr 2008 at 1:52, [EMAIL PROTECTED] wrote:

Hallo,

  (I have temporary appended 'dump;' to plain.mp)
  After the above, you should have plain.mem in the local
 directory.
  
  No.
  There is neither a 'plain.fmt' nor a 'plain.mem'!
 
 Everything I read below says there should be a 'plain.mem'
 in the folder where you ran theat file in.  If there
 really really isn't, then my only advise to you is to buy
 a less thieving operating system, as it seems this one steals
 your files before you can even have an admiring look at them. :-)

I tried the same with 'mpost'. This has the advantage that one has 
not to adapt 'plain.mp'.

But here too, there is no 'mpost.mem' and no 'mpost.log'.

I have included a test before and after mp:finish().

Can anybody with a minimal under windows run this example?
---
\starttext
% start low-level
\startlua
local function finder(name, mode, ftype)
 if mode==w then
 return name
 else
 return kpse.find_file(name,ftype)
 end
end
mp = mplib.new ( {
 hash_size = 10,
 main_memory = 200,
 param_size = 10,
 find_file = finder,
 ini_version = true
} )
if mp then
 res = mp:execute(mpost)
 tex.print([ .. tostring(res.status) .. ])
 print(table.serialize(res))
 if io.open(mpost.mem,r) then
   print(found)
 else
   print(nothing)
 end
 res = mp:finish()
 print(table.serialize(res))
 if io.open(mpost.mem,r) then
   print(found)
 else
   print(nothing)
 end
end
\stoplua
% stop low-level
\stoptext
---

Gruß, Wolfgang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-15 Thread Hans Hagen
Wolfgang Werners-Lucchini wrote:

 Is there a find_file function necessary to find the mem-file given in 
 'mem_name' or is such a function only necessary for file-names in 
 'mp:execute'?

the find function is needed

in context you can use

metapost.process('formatname',datastream)

this will generate the format if needed and reuse it



-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-15 Thread Taco Hoekwater
Wolfgang Werners-Lucchini wrote:
 if mp then
  res = mp:execute('plain')
  mp:finish()
 end
 
 this first step runs with res=0, but there is no 'plain.mem' dumped.

For the other readers: res itself can't really be zero. It is either
a table, or nil. The actual return value is the status field in the
table, and that can vary from 0 (good run) to 3 (extremely bad run),
and you can end up with nil if you have invalid arguments.

 (I have temporary appended 'dump;' to plain.mp)

After the above, you should have plain.mem in the local directory.
You can try printing res.term or res.log or even
   print(table.serialize(res))
to check if what mp is doing.

 after that I produced 'plain.mem' executing
 'texmfstart texexec --make plain'

I assume that will create a tex plain.fmt file. But even if it
does create a .mem file, you will not succeed unless you are using
newmpost from the mplib-alpha-0.40 distribution and the values
you sset up for hash_size, main_memory, and param_size in the loading
stage are identical to the values used by newmpost from texmf.cnf
during mem generation.

Best wishes, Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-15 Thread Wolfgang Werners-Lucchini
On 15 Apr 2008 at 13:31, [EMAIL PROTECTED] wrote:

Hallo Taco,

  (I have temporary appended 'dump;' to plain.mp)
 
 After the above, you should have plain.mem in the local directory.

No.
There is neither a 'plain.fmt' nor a 'plain.mem'!

I have searched in the local directory, where it should be.
It is not in 'D:\context\tex\texmf-mswin\web2c' where format-files 
usally exist.
It is not in the cache.

I run this:
---
\enableregime[utf-8]
\starttext
% start low-level
\startlua
local function finder(name, mode, ftype)
 if mode==w then
 return name
 else
 return kpse.find_file(name,ftype)
 end
end
mp = mplib.new ( {
 hash_size = 10,
 main_memory = 200,
 param_size = 10,
 find_file = finder,
 ini_version = true
} )
if mp then
 res = mp:execute(plain)
 print(table.serialize(res))
 res = mp:finish()
 print(table.serialize(res))
end
\stoplua
% stop low-level
\stoptext
---

with the following output:

---
t={
 [log]=This is MetaPost, Version 1.003 (INIMP)  15 APR 2008 21:00 
(plain.mpPreloading the plain mem file, version 0.99,
 [status]=0,
 [term]=This is MetaPost, Version 1.003 (Cweb version 0.40) 
(INIMP)\
 (plain.mpPreloading the plain mem file, version 0.99,
}
t={
 [log]= )\
Beginning to dump on file plain.mem\
 (mem=plain 8.4.15)\
at most 735 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
,
 [status]=0,
 [term]= )\
Beginning to dump on file plain.mem\
 (mem=plain 8.4.15)\
at most 735 strings of total length 3629\
3326 memory locations dumped; current usage is 10212227\
501 symbolic tokens\
Transcript written on plain.log.\
,
}
---

Can you see, what I am missing?

Wolfgang

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-15 Thread Taco Hoekwater
Wolfgang Werners-Lucchini wrote:
 On 15 Apr 2008 at 13:31, [EMAIL PROTECTED] wrote:
 
 Hallo Taco,
 
 (I have temporary appended 'dump;' to plain.mp)
 After the above, you should have plain.mem in the local directory.
 
 No.
 There is neither a 'plain.fmt' nor a 'plain.mem'!

Everything I read below says there should be a 'plain.mem'
in the folder where you ran theat file in.  If there
really really isn't, then my only advise to you is to buy
a less thieving operating system, as it seems this one steals
your files before you can even have an admiring look at them. :-)

Best wishes,
Taco




___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-14 Thread Wolfgang Werners-Lucchini
On 13 Apr 2008 at 13:31, [EMAIL PROTECTED] wrote:

Hallo Taco,

thank you for your example.

 % start low-level
 \startlua
 local function finder(name, mode, ftype)
  if mode==w then
  return name
  else
  return kpse.find_file(name,ftype)
  end
 end
 mp = mplib.new ( {
  hash_size = 10,
  main_memory = 200,
  param_size = 10,
  find_file = finder,
  ini_version = true
 } )
 if mp then
  res = mp:execute('plain')
  mp:finish()
 end

this first step runs with res=0, but there is no 'plain.mem' dumped.
(I have temporary appended 'dump;' to plain.mp)
this first step runs with res=0 with mp:execute('mpost'), but no 
'mpost.mem'
the first step even runs with res=0 and mp:execute('\\plain; dump;'), 
but no 'plain.mem'

after that I produced 'plain.mem' executing
'texmfstart texexec --make plain'

 
 mp = mplib.new ( {
  hash_size = 10,
  main_memory = 200,
  param_size = 10,
  find_file = finder,
 } )
 
 if mp then
  res = mp:execute(
 \\beginfig(1) draw (0,0) .. (1,1) .. (2,1); endfig; bye; )
  tex.print([ .. tostring(res.status) .. ])
  mp:finish()
 end
 \stoplua
 % stop low-level
 

this second step returns res=3.

Is there a find_file function necessary to find the mem-file given in 
'mem_name' or is such a function only necessary for file-names in 
'mp:execute'?

Wolfgang

-- 
Musensturm-Verlag -- Postfach 1249 -- 36126 Gersfeld 
 http://www.musensturm.de

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-13 Thread Taco Hoekwater
Wolfgang Werners-Lucchini wrote:
 On 12 Apr 2008 at 9:39, [EMAIL PROTECTED] wrote:
 
 \startlua
 mp = mplib.new ( {
 hash_size = 10,
 main_memory = 200,
 param_size = 10,
 } )

 if mp then
 res = mp:execute(
 beginfig(1) draw (0,0) .. (1,1) .. (2,1); endfig; bye; )
 tex.print([ .. tostring(res.status) .. ])
 mp:finish()
 end
 \stoplua
 no format, so beginfig, draw etc are unknown
 
 I thought 'plain.mem' is the default. But I see, there exists only 
 'metafun.mem'.

If you want to do the low-level thing, you have to read the
luatex manual carefully. MPlib is just like standalone metapost
in that it wants to load a mem file in non-ini mode, and that
file has to be generated before being used. Here is what you
wanted to do, using just the library core (I did cheat just a
little bit though, I added dump; at the end of my plain.mp):

% start low-level
\startlua
local function finder(name, mode, ftype)
 if mode==w then
 return name
 else
 return kpse.find_file(name,ftype)
 end
end
mp = mplib.new ( {
 hash_size = 10,
 main_memory = 200,
 param_size = 10,
 find_file = finder,
 ini_version = true
} )
if mp then
 res = mp:execute('plain')
 mp:finish()
end

mp = mplib.new ( {
 hash_size = 10,
 main_memory = 200,
 param_size = 10,
 find_file = finder,
} )

if mp then
 res = mp:execute(\\beginfig(1) draw (0,0) .. (1,1) .. (2,1); 
endfig; bye; )
 tex.print([ .. tostring(res.status) .. ])
 mp:finish()
end
\stoplua
% stop low-level

If you just want to run plain metapost images inside of
a context document (instead of metafun), it is much easier
to use Hans' high-level API (once again, you need dump;
at the end of plain.mp):

\startlua
metapost.process(
   metapost.format(plain),
   beginfig(0); draw (0,0) .. (1,1) .. (2,1); endfig;)
\stoplua

This makes sure that all memory values are the same,
that the mem file is cached inbetween runs, removes the
need for \\ and bye; etc.

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib undefined commands

2008-04-13 Thread Mojca Miklavec
Hi,

On Sat, Apr 12, 2008 at 9:38 AM, Hans Hagen wrote:

   2.) undefined command
\forceMPTEXcheck{put_text}

  ok, i will add a fake

Thanks.


   I have now used a wrapper to skip that line in LuaTeX (btw: what's the
   suggested \if clause or \beginNOLUATEX to check for luatex/mkiv?) Does
   it make sense to define \let\forceMPTEXcheck\empty in mkiv perhaps?

  best make a

  yourmodule.tex
  yourmodule.mkii
  yourmodule.mkiv

  and in the tex file adds:

  \loadmarkfile{yourmodule}

OK, once I rewrite some more code than a few lines, I will split it
(but now there are really only minor, one-line patches).

   3.) undefined command \obeyMPlines. I actually forgot why I needed it,
   but according to the comment:
   \obeyMPlines % - no longer a problem
   \def\obeyedline{}% - thanks to this
   I simply commented out the first line and hoped for no problems in mkii

  ok, another fake

Thanks. Still - I don't know if it's still needed at all and what
exactly it was used for (maybe metapost has complained about too long
lines long time ago).

   4.) It seems to work without problems now, except for one tiny detail
   that I get in the final PDF.
   [do we need TeXtexts in MkIV]
  
   What is that supposed to mean?

  well, that everything now can be 'textext'


   I need to admit that I have the following piece of code in the module
   (in case that matters). Maybe I'm the only one who uses it, so if you
   have any idea how to modify the macros to make
   \sometxt[gp][iwona,14pt]{text} work in mkiv, I will happily drop the
   old code/replace it for mkiv.

  hm, so \sometxt is not working? i thought that i tested it (maybe not
  ... too much to test)

\sometxt is working, only some Aditya's extensions complain. I will
test a bit, try to rewrite some bits and pieces, collect the missing
parts and report back.


   \long\def\redofiltersometxt[#1]%
   {\doifnextcharelse[{\reredofiltersometxt[#1]}{\redodofiltersometxt[#1]}}
  
   \long\def\redodofiltersometxt[#1]#2%
 {\increment\txtcounter
  \TeXtext[#1]\txtcounter{#2}%
  \filtersometxt}
  
   \long\def\reredofiltersometxt[#1][#2]#3%
 {\increment\txtcounter
  \TeXtext[#1]\txtcounter{\switchtobodyfont[#2]\strut#3}%
  \filtersometxt}

  i think that we have it in the core

You have added the ability to use
\sometxt[something]{abc}
with a background definition of:
\definetextext[something]{\strut}
but I wanted to have two square brackets and Aditya has written a
small patch which does that. Let me explore a bit more in the new mkiv
sources and report back.

  anyhow, just collects what does not work

  (btw, i fixed something in textext ... i used to work only for code
  passed as mpgraphic, but now it works also with libraries and so)

Thanks :) I didn't notice any weird behaviour so far, but I'm glad
that it's away before I started complaining about it :) :P

Mojca
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib undefined commands

2008-04-13 Thread Hans Hagen
Mojca Miklavec wrote:

 Thanks. Still - I don't know if it's still needed at all and what
 exactly it was used for (maybe metapost has complained about too long
 lines long time ago).

indeed; also, at some point texexec would take care of it; nowadays the 
limitation is gone (in tex and mp)

 \sometxt is working, only some Aditya's extensions complain. I will
 test a bit, try to rewrite some bits and pieces, collect the missing
 parts and report back.

ok

 You have added the ability to use
 \sometxt[something]{abc}
 with a background definition of:
 \definetextext[something]{\strut}
 but I wanted to have two square brackets and Aditya has written a
 small patch which does that. Let me explore a bit more in the new mkiv
 sources and report back.

ok; keep in mind that in mkii things are bit tricky because there 
\sometxt is expanded first and replace by a reference next and a on 
standard optional [ parser is used

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-12 Thread Hans Hagen
Wolfgang Werners-Lucchini wrote:
 Hallo,
 
 the following compiles ok, but gives me an status 3=fatal error.
 Can someone please point me to the error?
 
 \startlua
 mp = mplib.new ( {
 hash_size = 10,
 main_memory = 200,
 param_size = 10,
 } )
 
 if mp then
 res = mp:execute(
 beginfig(1) draw (0,0) .. (1,1) .. (2,1); endfig; bye; )
 tex.print([ .. tostring(res.status) .. ])
 mp:finish()
 end
 \stoplua

no format, so beginfig, draw etc are unknown

metapost.process(metafun,some commands)

may work better

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib undefined commands

2008-04-12 Thread Hans Hagen
Hi Mojca

 I have modified the gnuplot module a bit, and stumbled upon:
 
 1.) the need for
  \ifx\savebuffer\undefined \else \savebuffer[...]\fi
 which has been expected
 
 2.) undefined command
  \forceMPTEXcheck{put_text}

ok, i will add a fake

 I have now used a wrapper to skip that line in LuaTeX (btw: what's the
 suggested \if clause or \beginNOLUATEX to check for luatex/mkiv?) Does
 it make sense to define \let\forceMPTEXcheck\empty in mkiv perhaps?

best make a

yourmodule.tex
yourmodule.mkii
yourmodule.mkiv

and in the tex file adds:

\loadmarkfile{yourmodule}


 3.) undefined command \obeyMPlines. I actually forgot why I needed it,
 but according to the comment:
 \obeyMPlines % - no longer a problem
 \def\obeyedline{}% - thanks to this
 I simply commented out the first line and hoped for no problems in mkii

ok, another fake

 4.) It seems to work without problems now, except for one tiny detail
 that I get in the final PDF.
 [do we need TeXtexts in MkIV]
 
 What is that supposed to mean?

well, that everything now can be 'textext'

 I need to admit that I have the following piece of code in the module
 (in case that matters). Maybe I'm the only one who uses it, so if you
 have any idea how to modify the macros to make
 \sometxt[gp][iwona,14pt]{text} work in mkiv, I will happily drop the
 old code/replace it for mkiv.

hm, so \sometxt is not working? i thought that i tested it (maybe not 
... too much to test)

 \long\def\redofiltersometxt[#1]%
 {\doifnextcharelse[{\reredofiltersometxt[#1]}{\redodofiltersometxt[#1]}}
 
 \long\def\redodofiltersometxt[#1]#2%
   {\increment\txtcounter
\TeXtext[#1]\txtcounter{#2}%
\filtersometxt}
 
 \long\def\reredofiltersometxt[#1][#2]#3%
   {\increment\txtcounter
\TeXtext[#1]\txtcounter{\switchtobodyfont[#2]\strut#3}%
\filtersometxt}

i think that we have it in the core


anyhow, just collects what does not work

(btw, i fixed something in textext ... i used to work only for code 
passed as mpgraphic, but now it works also with libraries and so)


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-04-12 Thread Wolfgang Werners-Lucchini
On 12 Apr 2008 at 9:39, [EMAIL PROTECTED] wrote:

  \startlua
  mp = mplib.new ( {
  hash_size = 10,
  main_memory = 200,
  param_size = 10,
  } )
  
  if mp then
  res = mp:execute(
  beginfig(1) draw (0,0) .. (1,1) .. (2,1); endfig; bye; )
  tex.print([ .. tostring(res.status) .. ])
  mp:finish()
  end
  \stoplua
 
 no format, so beginfig, draw etc are unknown

I thought 'plain.mem' is the default. But I see, there exists only 
'metafun.mem'.

So I  wrote:
--
mp = mplib.new ( {
hash_size = 10,
main_memory = 200,
param_size = 10,
mem_name = metafun.mem
} )
--
and it get the same result

 metapost.process(metafun,some commands)
 
 may work better
--
\startlua
mp = mplib.new ( {
hash_size = 10,
main_memory = 200,
param_size = 10
} )

if mp then
res = metapost.process(metafun,beginfig(1) draw (0,0) .. (1,1) 
.. (2,1); endfig; bye;)
tex.print([ .. tostring(res.status) .. ])
mp:finish()
end
\stoplua
--

results in :

--
mplib  : loading format: metafun.mp, name: 
d:/context/tex/texmf-cache/luatex-
cache/context/c80dc1fd5292ec817c6e82c295beaf1e/formats/cont-en-
metafun.mem
! Emergency stop.
\@@expanded . ])
-- mp:finish()
-- end
}
  
l.54 \stoplua
 
!  == Fatal error occurred, no output PDF file produced!
--

why does it load 'metafun.mp'?


after that I tried

--
\startlua
mp = mplib.new ( {
hash_size = 10,
main_memory = 200,
param_size = 10,
mem_name = metafun.mem
} )

if mp then
res = metapost.process(mp,
 beginfig(1) draw (0,0) .. (1,1) .. (2,1); endfig; bye;)
tex.print([ .. tostring(res.status) .. ])
mp:finish()
end
\stoplua
--

which gives the following error:

--
report  error: This is MetaPost, Version 1.003 (Cweb version 0.40)

I can't find the PLAIN mem file!
--


What else should I check to find the error?

Wolfgang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-16 Thread zs
On Sat, 15 Mar 2008 11:18:33 +0100
Hans Hagen [EMAIL PROTECTED] wrote:

 btw, how difficult would it be to add a lua api to gnuplot, in which 
 case we could communicate via lua tables
 
 Hans


btw: Some of you may not know about cairo library. (http://cairographics.org/)
It's versatile graphic library with many output targets(pdf,svg,png,...) and 
bindings to different programming languages (including lua!).
It can do almost the same things that metapost do.
Development version of gnulpot should be able to use cairo library for 
rendering too.



  ZS
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-16 Thread Mojca Miklavec
On Sun, Mar 16, 2008 at 10:58 AM, zs [EMAIL PROTECTED] wrote:
 On Sat, 15 Mar 2008 11:18:33 +0100
  Hans Hagen [EMAIL PROTECTED] wrote:

   btw, how difficult would it be to add a lua api to gnuplot, in which
   case we could communicate via lua tables
  
   Hans


  btw: Some of you may not know about cairo library. 
 (http://cairographics.org/)
  It's versatile graphic library with many output targets(pdf,svg,png,...) and 
 bindings to different programming languages (including lua!).
  It can do almost the same things that metapost do.
  Development version of gnulpot should be able to use cairo library for 
 rendering too.

Cairo (with pango, that needs lots of tweaking to be able to build it,
I do not even dare dreaming about being able to build it on windows)
is able to generate PDFs in gnuplot, but not to input any TeX labels
yet, I'm affraid.

Mojca
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-15 Thread Hans Hagen
Mojca Miklavec wrote:
 On Fri, Mar 14, 2008 at 6:51 PM, Aditya Mahajan wrote:
 On Fri, 14 Mar 2008, Hans Hagen wrote:

   so, if you have specific wishes ... now is the time to let them know

  Some questions (and hidden wishes)

  Does this mean that text between metapost graphic and context can be
  really transparent? Currently \sometxt does not work with all macros,
  (like an old feature request by Mojca to have two optional arguments for
  setting the font in the gnuplot module). Will mplib mean that the metapost
  code can place any tex box at the desired location?
 
 Now that you mention it: I still need to adapt the gnuplot module to
 mkiv, but I'm a bit afraid of asking for help. (The most important
 thing would be to get rid of that stupid catcode trickery inside
 \startGNUPLOTscript ... \stopGNUPLOTscript that always tends to fail
 when one needs it, and to have one-to-one conversion, so that %,#, $,
  will have no special meaning.) Then, it would probably be a nice
 benchmark to discover bugs in the library :)
 
 For example, demos from this page (I'm not saying that they're too
 useful since 100x100 is too low resolution anyway):
  http://gnuplot.sourceforge.net/demo_4.3/pm3d.html
 currently all fail because of the out-of-memory problem (10.000
 times fill unitsquare scaled ... shifted ... withcolor ...), but
 this might be a ConTeXt problem as well (the text inside
 \startMPgraphic ... \stopMPgraphic probably needs to be stored
 somewhere in TeX, even if there's no need for that).

let's discuss this a few months from now when i have more code in place

btw, how difficult would it be to add a lua api to gnuplot, in which 
case we could communicate via lua tables

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-15 Thread Mojca Miklavec
On Sat, Mar 15, 2008 at 11:18 AM, Hans Hagen wrote:

 Mojca Miklavec wrote:
   On Fri, Mar 14, 2008 at 6:51 PM, Aditya Mahajan wrote:
   On Fri, 14 Mar 2008, Hans Hagen wrote:
  
 so, if you have specific wishes ... now is the time to let them know
  
Some questions (and hidden wishes)
  
Does this mean that text between metapost graphic and context can be
really transparent? Currently \sometxt does not work with all macros,
(like an old feature request by Mojca to have two optional arguments for
setting the font in the gnuplot module). Will mplib mean that the 
 metapost
code can place any tex box at the desired location?
  
   Now that you mention it: I still need to adapt the gnuplot module to
   mkiv, but I'm a bit afraid of asking for help. (The most important
   thing would be to get rid of that stupid catcode trickery inside
   \startGNUPLOTscript ... \stopGNUPLOTscript that always tends to fail
   when one needs it, and to have one-to-one conversion, so that %,#, $,
    will have no special meaning.) Then, it would probably be a nice
   benchmark to discover bugs in the library :)
  
   For example, demos from this page (I'm not saying that they're too
   useful since 100x100 is too low resolution anyway):
http://gnuplot.sourceforge.net/demo_4.3/pm3d.html
   currently all fail because of the out-of-memory problem (10.000
   times fill unitsquare scaled ... shifted ... withcolor ...), but
   this might be a ConTeXt problem as well (the text inside
   \startMPgraphic ... \stopMPgraphic probably needs to be stored
   somewhere in TeX, even if there's no need for that).

  let's discuss this a few months from now when i have more code in place

  btw, how difficult would it be to add a lua api to gnuplot, in which
  case we could communicate via lua tables

Peter Hedwig has already done some work on it:
http://peter.affenbande.org/gnuplot/

What his patch does: one calls gnuplot normally, and then, when you say
   set term lua dashed fontsize 15
dashed fontsize 15 is parsed by lua. Then, gnuplot does its work,
and calls functions:
   set_linestyle(3)
   set_color(...)
   draw_line(...)
What Peter did was a mapping from C to lua, so the actual code that
does draw_line is actually implemented in lua and can easily be
changed and/or adapted without recompiling gnuplot.

He now converts those function calls into TikZ Code, but that could
easily be adapted into anything.

So: output has already been implemented (and would only need to be
adapted), while input might need some tweaking. I'm sometimes using a
rather simple C++ library which opens gnuplot and pipes set terminal
..., plot ... commands to gnuplot, so one can pass a C table to
gnuplot. I could take a look at how it's done there. How do you
imagine passing lua tables to gnuplot?

Mojca

PS: no need to say that even though his terminal is much more popular
(it's the only decent LaTeX terminal I know) than the one for ConTeXt,
I have seen zero discussion on the gnuplot mailing list about any
intentions to integrate that code into gnuplot core.
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-14 Thread Hans Hagen
Santy, Michael wrote:
 Hans,
 
 Sounds pretty impressive.  As a point of reference, do you have timing 
 data for the existing MKII and MKIV image processing code?

you mean a difference in speed? it depends on how complex the search is, 
but in general the mkiv code is faster and more robust there and has 
more potential for plugins; also mkiv does runtime conversion if needed; 
of course inclusion itself is not faster while (eventually) manipulation 
will be

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-14 Thread Aditya Mahajan
On Fri, 14 Mar 2008, Hans Hagen wrote:

 Hi,

 as some of you may know, there is an mplib project ..

 last week taco and spent quite some time on exploring the integration in
 luatex (and therefore mkiv)

 experiments with loadiing the format, processing graphics and conversion
 to pdf show a throughput of less than 0.001 seconds per graphic; a usual
 we did much timing and although experimental, the code is already pretty
 okay, just to give an idea:

   mkiv lua stats : metapost processing time  - 6.834 seconds (loading:
 0.014 seconds, execution: 1.474 seconds, n: 15000)

 indeed, that's 15K graphics in 7 seconds.

That is really impressive.

 so, the next couple of months i'll start providing an adapted mp
 handling mechanisms. among the possible options are

 - extensions based on pre/postscripts (instead of specials)
 - multiple mp engines (\startuseMPgraphic[metafun]{name} and such)

 so, if you have specific wishes ... now is the time to let them know

Some questions (and hidden wishes)

Does this mean that text between metapost graphic and context can be 
really transparent? Currently \sometxt does not work with all macros, 
(like an old feature request by Mojca to have two optional arguments for 
setting the font in the gnuplot module). Will mplib mean that the metapost 
code can place any tex box at the desired location?

One thing which is really shaky in the current implementation is page 
anchors. That is, marking something in a paragraph and then using the page 
background to draw lines between different elements. Will such things be 
easier to do and work correctly with display math? (I want to use these 
effects in presentations, but have never managed to get a satisfactory 
solution that works in display math).

I am assuming that there will be hooks so that packages like tikz to move 
to a mplib backend.

Thanks,

Aditya
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-14 Thread Santy, Michael
Its entirely possible that I'm missing something, but I was merely inquiring 
about running the same timing tests that you did with mplib, but instead using 
the existing MKII and MKIV image inclusion code.  How much of a speedup over 
the existing code does the mplib integration buy us for this benchmark?


-Original Message-
From: [EMAIL PROTECTED] on behalf of Hans Hagen
Sent: Fri 3/14/2008 12:46 PM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] mplib
 
Santy, Michael wrote:
 Hans,
 
 Sounds pretty impressive.  As a point of reference, do you have timing 
 data for the existing MKII and MKIV image processing code?

you mean a difference in speed? it depends on how complex the search is, 
but in general the mkiv code is faster and more robust there and has 
more potential for plugins; also mkiv does runtime conversion if needed; 
of course inclusion itself is not faster while (eventually) manipulation 
will be

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-14 Thread Santy, Michael
Hans,

Sounds pretty impressive.  As a point of reference, do you have timing 
data for the existing MKII and MKIV image processing code?

Cheers,
Mike


-Original Message-
From: [EMAIL PROTECTED] on behalf of Hans Hagen
Sent: Fri 3/14/2008 12:21 PM
To: mailing list for ConTeXt users
Subject: [NTG-context] mplib
 
Hi,

as some of you may know, there is an mplib project ..

last week taco and spent quite some time on exploring the integration in 
luatex (and therefore mkiv)

experiments with loadiing the format, processing graphics and conversion 
to pdf show a throughput of less than 0.001 seconds per graphic; a usual 
we did much timing and although experimental, the code is already pretty 
okay, just to give an idea:

mkiv lua stats : metapost processing time  - 6.834 seconds (loading: 
0.014 seconds, execution: 1.474 seconds, n: 15000)

indeed, that's 15K graphics in 7 seconds.

so, the next couple of months i'll start providing an adapted mp 
handling mechanisms. among the possible options are

- extensions based on pre/postscripts (instead of specials)
- multiple mp engines (\startuseMPgraphic[metafun]{name} and such)

so, if you have specific wishes ... now is the time to let them know


Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-14 Thread Hans Hagen
Santy, Michael wrote:
 Its entirely possible that I'm missing something, but I was merely inquiring 
 about running the same timing tests that you did with mplib, but instead 
 using the existing MKII and MKIV image inclusion code.  How much of a speedup 
 over the existing code does the mplib integration buy us for this benchmark?

well, processing 15K mp graphics either runtime or delayed would take 
way much time (no fun timing)

it all depends on how you use mp graphics, but for most purposes mp 
processing time goes down to nearly zero

btw, mkiv mp inclusion code is faster than mkii code

Hans


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
  | www.pragma-pod.nl
-
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-14 Thread Taco Hoekwater
Hans Hagen wrote:
 Santy, Michael wrote:
 Its entirely possible that I'm missing something, but I was merely
 inquiring about running the same timing tests that you did with
 mplib, but instead using the existing MKII and MKIV image inclusion
 code.  How much of a speedup over the existing code does the mplib
 integration buy us for this benchmark?
 
 well, processing 15K mp graphics either runtime or delayed would take
  way much time (no fun timing)

IIRC, beginning of the week we had a speedup of 50% against oldfashioned
mkiv (mptopdf-in-lua) with a batched Metapost run, which is alread some 
25% faster than batched Metapost in mkii mode (mptopdf-in-tex). And that
was before we started optimizing, we are at least twice as fast now as
we were then.

And in the old system, batched metapost was a whole lot faster than
runtime Metapost.

Take a look at it this way: if you have a document stuffed full of
backgrounds and borders and decorations, you may have a dozen unique
decorations per page. On a 200-page book, the total runtime used by
the new MPlib-based graphics system is then still less than a second
(well, if you were using Hans' machine).

Best wishes,
Taco




___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2008-03-14 Thread Mojca Miklavec
On Fri, Mar 14, 2008 at 6:51 PM, Aditya Mahajan wrote:
 On Fri, 14 Mar 2008, Hans Hagen wrote:

   so, if you have specific wishes ... now is the time to let them know

  Some questions (and hidden wishes)

  Does this mean that text between metapost graphic and context can be
  really transparent? Currently \sometxt does not work with all macros,
  (like an old feature request by Mojca to have two optional arguments for
  setting the font in the gnuplot module). Will mplib mean that the metapost
  code can place any tex box at the desired location?

Now that you mention it: I still need to adapt the gnuplot module to
mkiv, but I'm a bit afraid of asking for help. (The most important
thing would be to get rid of that stupid catcode trickery inside
\startGNUPLOTscript ... \stopGNUPLOTscript that always tends to fail
when one needs it, and to have one-to-one conversion, so that %,#, $,
... will have no special meaning.) Then, it would probably be a nice
benchmark to discover bugs in the library :)

For example, demos from this page (I'm not saying that they're too
useful since 100x100 is too low resolution anyway):
 http://gnuplot.sourceforge.net/demo_4.3/pm3d.html
currently all fail because of the out-of-memory problem (10.000
times fill unitsquare scaled ... shifted ... withcolor ...), but
this might be a ConTeXt problem as well (the text inside
\startMPgraphic ... \stopMPgraphic probably needs to be stored
somewhere in TeX, even if there's no need for that).

Mojca
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] mplib

2007-03-19 Thread Hans Hagen
Hi,

In addition to previous mails about the mplib project we now have 
funding for the programming part of the mplib project  (budgetted 12KEURO)

- dante : 6K
- tug : 1.5K
- tug india : 1K
- ntg : 2K
- cstug : 1K
- gust: will fund a sub-project (metatype1 completion)

TUG indicated that next year there could be additional funding but it 
looks like .5K is enough then, which means that the project funcing is 
secured.

This project is especially nice because it permits us to have a tight 
luatex/mp pair. LuaTeX (opened up, configurable, tunable pdftex), 
TeXGyre (8 open type fonts, finaly with math etc), and MPLib (integrated 
graphical engine) help us boost tex into the  future and without funding 
the programming and font conversion effort, i fear it would have taken 
many more years.

It also means that some of you will have to do some pretty hefty testing 
of both machineries at the end of the year since context mkiv will be 
used as testbed.

It may be clear that projects like this put quite a financial burden on 
user groups (there is already substantial continuous funding of texgyre 
by the mentioned user groups) and luatex is also sponsored (by oriental 
tex project as well as tug). Projects like this put a dent in the 
financial reserves of lugs.

So ... if you're not yet a member of a local user group or tug ... 
consider joining since it's the user groups that keep the good work done 
...

Soon there will also be the option to support specific projects (tug 
project page).

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] mplib

2007-03-19 Thread Karl Berry
Soon there will also be the option to support specific projects (tug 
project page).

It is possible to contribute specifically to TUG's development fund,
which is TUG's pigeonhole for dev projects, at
https://www.tug.org/donate.html.  Any donations to that now will end up
going to luatex/mplib.

Donations are, of course, greatly appreciated :).  As Hans said, new
members for TUG (http://tug.org/join.html) or any other user group
(http://tug.org/usergroups.html) are also greatly appreciated.

Cheers,
Karl
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] mplib

2007-03-19 Thread Sanjoy Mahajan
 It also means that some of you will have to do some pretty hefty
 testing of both machineries at the end of the year since context
 mkiv will be used as testbed.

I'll happy write lots of testing scripts.  It'll be an unholy mixture
of bash, make, python, scheme, and (once I learn them) lua and ruby.

-Sanjoy

`Not all those who wander are lost.' (J.R.R. Tolkien)
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context