* mplib errors @ 2008-09-29 15:55 Olivier 2008-09-29 18:03 ` luigi scarso ` (2 more replies) 0 siblings, 3 replies; 24+ messages in thread From: Olivier @ 2008-09-29 15:55 UTC (permalink / raw) To: ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 15:55 mplib errors Olivier @ 2008-09-29 18:03 ` luigi scarso 2008-09-29 19:44 ` Olivier 2008-09-29 20:00 ` Hans van der Meer 2008-09-30 9:27 ` Ulrike Fischer 2 siblings, 1 reply; 24+ messages in thread From: luigi scarso @ 2008-09-29 18:03 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 870 bytes --] On Mon, Sep 29, 2008 at 5:55 PM, Olivier <billet@eurecom.fr> 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 [-- Attachment #1.2: Type: text/html, Size: 1351 bytes --] [-- Attachment #2: Type: text/plain, Size: 487 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 18:03 ` luigi scarso @ 2008-09-29 19:44 ` Olivier 2008-09-29 21:45 ` luigi scarso 0 siblings, 1 reply; 24+ messages in thread From: Olivier @ 2008-09-29 19:44 UTC (permalink / raw) To: ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 19:44 ` Olivier @ 2008-09-29 21:45 ` luigi scarso 2008-09-30 8:54 ` Olivier 0 siblings, 1 reply; 24+ messages in thread From: luigi scarso @ 2008-09-29 21:45 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 809 bytes --] On Mon, Sep 29, 2008 at 9:44 PM, Olivier <billet@eurecom.fr> 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 [-- Attachment #1.2: Type: text/html, Size: 1493 bytes --] [-- Attachment #2: test-oliver.pdf --] [-- Type: application/pdf, Size: 2736 bytes --] [-- Attachment #3: Type: text/plain, Size: 487 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 21:45 ` luigi scarso @ 2008-09-30 8:54 ` Olivier 2008-09-30 9:14 ` luigi scarso 0 siblings, 1 reply; 24+ messages in thread From: Olivier @ 2008-09-30 8:54 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 8:54 ` Olivier @ 2008-09-30 9:14 ` luigi scarso 0 siblings, 0 replies; 24+ messages in thread From: luigi scarso @ 2008-09-30 9:14 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 1578 bytes --] On Tue, Sep 30, 2008 at 10:54 AM, Olivier <billet@eurecom.fr> 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 [-- Attachment #1.2: Type: text/html, Size: 2065 bytes --] [-- Attachment #2: Type: text/plain, Size: 487 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 15:55 mplib errors Olivier 2008-09-29 18:03 ` luigi scarso @ 2008-09-29 20:00 ` Hans van der Meer 2008-09-29 20:10 ` Taco Hoekwater 2008-09-30 9:27 ` Ulrike Fischer 2 siblings, 1 reply; 24+ messages in thread From: Hans van der Meer @ 2008-09-29 20:00 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 20:00 ` Hans van der Meer @ 2008-09-29 20:10 ` Taco Hoekwater 2008-09-29 20:46 ` Olivier 2008-09-29 21:57 ` Hans van der Meer 0 siblings, 2 replies; 24+ messages in thread From: Taco Hoekwater @ 2008-09-29 20:10 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 20:10 ` Taco Hoekwater @ 2008-09-29 20:46 ` Olivier 2008-09-29 21:27 ` Taco Hoekwater 2008-09-29 21:57 ` Hans van der Meer 1 sibling, 1 reply; 24+ messages in thread From: Olivier @ 2008-09-29 20:46 UTC (permalink / raw) To: mailing list for ConTeXt users 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 %D version=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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 20:46 ` Olivier @ 2008-09-29 21:27 ` Taco Hoekwater 2008-09-30 9:40 ` Olivier 0 siblings, 1 reply; 24+ messages in thread From: Taco Hoekwater @ 2008-09-29 21:27 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 21:27 ` Taco Hoekwater @ 2008-09-30 9:40 ` Olivier 2008-09-30 9:58 ` Taco Hoekwater 0 siblings, 1 reply; 24+ messages in thread From: Olivier @ 2008-09-30 9:40 UTC (permalink / raw) To: mailing list for ConTeXt users Hi Taco, Quoting "Taco Hoekwater" : > -- was taco@elvenkind.com 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 9:40 ` Olivier @ 2008-09-30 9:58 ` Taco Hoekwater 2008-09-30 15:45 ` Olivier 0 siblings, 1 reply; 24+ messages in thread From: Taco Hoekwater @ 2008-09-30 9:58 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 9:58 ` Taco Hoekwater @ 2008-09-30 15:45 ` Olivier 2008-10-01 9:14 ` Taco Hoekwater 0 siblings, 1 reply; 24+ messages in thread From: Olivier @ 2008-09-30 15:45 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 15:45 ` Olivier @ 2008-10-01 9:14 ` Taco Hoekwater 2008-10-01 13:57 ` Olivier 0 siblings, 1 reply; 24+ messages in thread From: Taco Hoekwater @ 2008-10-01 9:14 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1: Type: text/plain, Size: 771 bytes --] 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 [-- Attachment #2: mplib.lua --] [-- Type: text/plain, Size: 2114 bytes --] 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 = 100000, main_memory = 2000000, max_in_open = 50, param_size = 100000, 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 [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #3: mplibtest.tex --] [-- Type: text/x-tex; name="mplibtest.tex", Size: 1557 bytes --] \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 [-- Attachment #4: Type: text/plain, Size: 487 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-10-01 9:14 ` Taco Hoekwater @ 2008-10-01 13:57 ` Olivier 2008-10-01 14:08 ` Taco Hoekwater 0 siblings, 1 reply; 24+ messages in thread From: Olivier @ 2008-10-01 13:57 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-10-01 13:57 ` Olivier @ 2008-10-01 14:08 ` Taco Hoekwater 2008-10-01 14:27 ` Olivier 0 siblings, 1 reply; 24+ messages in thread From: Taco Hoekwater @ 2008-10-01 14:08 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-10-01 14:08 ` Taco Hoekwater @ 2008-10-01 14:27 ` Olivier 0 siblings, 0 replies; 24+ messages in thread From: Olivier @ 2008-10-01 14:27 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 20:10 ` Taco Hoekwater 2008-09-29 20:46 ` Olivier @ 2008-09-29 21:57 ` Hans van der Meer 2008-09-30 7:35 ` Taco Hoekwater 1 sibling, 1 reply; 24+ messages in thread From: Hans van der Meer @ 2008-09-29 21:57 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 21:57 ` Hans van der Meer @ 2008-09-30 7:35 ` Taco Hoekwater 0 siblings, 0 replies; 24+ messages in thread From: Taco Hoekwater @ 2008-09-30 7:35 UTC (permalink / raw) To: mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-29 15:55 mplib errors Olivier 2008-09-29 18:03 ` luigi scarso 2008-09-29 20:00 ` Hans van der Meer @ 2008-09-30 9:27 ` Ulrike Fischer 2008-09-30 9:37 ` Olivier 2008-09-30 12:11 ` Hans Hagen 2 siblings, 2 replies; 24+ messages in thread From: Ulrike Fischer @ 2008-09-30 9:27 UTC (permalink / raw) To: ntg-context 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 9:27 ` Ulrike Fischer @ 2008-09-30 9:37 ` Olivier 2008-09-30 10:10 ` Ulrike Fischer 2008-09-30 12:11 ` Hans Hagen 1 sibling, 1 reply; 24+ messages in thread From: Olivier @ 2008-09-30 9:37 UTC (permalink / raw) To: news2, mailing list for ConTeXt users Hi Ulrike, Quoting "Ulrike Fischer" : > -- was news2@nililand.de 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 9:37 ` Olivier @ 2008-09-30 10:10 ` Ulrike Fischer 2008-09-30 10:57 ` Hans Hagen 0 siblings, 1 reply; 24+ messages in thread From: Ulrike Fischer @ 2008-09-30 10:10 UTC (permalink / raw) To: ntg-context 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 10:10 ` Ulrike Fischer @ 2008-09-30 10:57 ` Hans Hagen 0 siblings, 0 replies; 24+ messages in thread From: Hans Hagen @ 2008-09-30 10:57 UTC (permalink / raw) To: news2, mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: mplib errors 2008-09-30 9:27 ` Ulrike Fischer 2008-09-30 9:37 ` Olivier @ 2008-09-30 12:11 ` Hans Hagen 1 sibling, 0 replies; 24+ messages in thread From: Hans Hagen @ 2008-09-30 12:11 UTC (permalink / raw) To: news2, mailing list for ConTeXt users 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2008-10-01 14:27 UTC | newest] Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-09-29 15:55 mplib errors Olivier 2008-09-29 18:03 ` luigi scarso 2008-09-29 19:44 ` Olivier 2008-09-29 21:45 ` luigi scarso 2008-09-30 8:54 ` Olivier 2008-09-30 9:14 ` luigi scarso 2008-09-29 20:00 ` Hans van der Meer 2008-09-29 20:10 ` Taco Hoekwater 2008-09-29 20:46 ` Olivier 2008-09-29 21:27 ` Taco Hoekwater 2008-09-30 9:40 ` Olivier 2008-09-30 9:58 ` Taco Hoekwater 2008-09-30 15:45 ` Olivier 2008-10-01 9:14 ` Taco Hoekwater 2008-10-01 13:57 ` Olivier 2008-10-01 14:08 ` Taco Hoekwater 2008-10-01 14:27 ` Olivier 2008-09-29 21:57 ` Hans van der Meer 2008-09-30 7:35 ` Taco Hoekwater 2008-09-30 9:27 ` Ulrike Fischer 2008-09-30 9:37 ` Olivier 2008-09-30 10:10 ` Ulrike Fischer 2008-09-30 10:57 ` Hans Hagen 2008-09-30 12:11 ` Hans Hagen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).