From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/12480 Path: main.gmane.org!not-for-mail From: Pierre VINET Newsgroups: gmane.comp.tex.context Subject: Re: Runtime graphics Date: Sun, 15 Jun 2003 02:45:15 -0400 Sender: ntg-context-admin@ntg.nl Message-ID: References: <5.2.0.9.1.20030614110347.02d1d5a0@localhost> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: main.gmane.org 1055659717 11843 80.91.224.249 (15 Jun 2003 06:48:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 15 Jun 2003 06:48:37 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Sun Jun 15 08:48:33 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19RRJZ-00034n-00 for ; Sun, 15 Jun 2003 08:48:33 +0200 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 0199E10B13; Sun, 15 Jun 2003 08:51:12 +0200 (MEST) Original-Received: from dartagnan.telusquebec.com (dartagnan.telusquebec.com [142.169.1.123]) by ref.ntg.nl (Postfix) with ESMTP id 7FDD310AF9 for ; Sun, 15 Jun 2003 08:47:18 +0200 (MEST) Original-Received: from [142.169.53.223] (ts1-167.f134.globetrotter.net [142.169.53.223]) by smtp.globetrotter.net (iPlanet Messaging Server 5.2) with ESMTP id <0HGI009XCG6CZV@"TELUS Quebec"> for ntg-context@ntg.nl; Sun, 15 Jun 2003 02:47:02 -0400 (EDT) In-reply-to: <5.2.0.9.1.20030614110347.02d1d5a0@localhost> Original-To: ntg-context@ntg.nl User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2106 Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:12480 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:12480 Hi Hans, Thank you for your reply. Here is the modified test.tex file following your indications : \starttext \def\MPrunfile#1{\bufferprefix \MyMpRunFile.#1} \def\MyMpRunFile{graphserieA} \startMPrun input graphserieA \stopMPrun \externalfigure[\MyMpRunFile.1] \externalfigure[\MyMpRunFile.2] % \def\MyMpRunFile{graphserieB} \startMPrun input graphserieB \stopMPrun \externalfigure[\MyMpRunFile.1] \externalfigure[\MyMpRunFile.2] \stoptext \end . The test.pdf output now show four gray boxes with the following messages in their center " name: dummy file: graphserieA.1 state: unknown " (with graphserieA.2 in the 2nd box, graphserieB.1 in the 3rd, etc.) The test.log file tell " \openout5 = `test-mprun.mp'. system(mpost -progname=mpost -mem=metafun test-mprun)...executed. figures : figure graphserieA can not be found figures : figure graphserieA can not be found \openout5 = `test-mprun.mp'. system(mpost -progname=mpost -mem=metafun test-mprun)...executed. figures : figure graphserieB can not be found figures : figure graphserieB can not be found " The figures are not found because a file named "test-mprun.mp" is still created and metapost's output are still named "test-mprun.*" instead of "\MyMpRunFile.*". Obviously, \externalfigure can not found any "\MyMpRunFile.*" files. If I use \externalfigure[mprun.*] instead of \externalfigure[\MyMpRunFile.*], then the first metapost's output files "test-mprun.1" and "test-mprun.2" are still re-used -?by \externalfigure?- after the second \startMPrun .. \stopMPrun call. (A -?simple?- way to avoid this systematic re-use of metapost's output would be, in my opinion, the best of all solutions). In the present case, I think the problem could be resolved if the "*-mprun.mp" files were labeled with the prefix name of the metapost file instead of the "jobname". Thus, for instance, we may read in the log file after the first \startMPrun .. \stopMPrun call \openout5 = `graphserieA-mprun.mp'. system(mpost -progname=mpost -mem=metafun graphserieA-mprun)...executed. and after the second \startMPrun .. \stopMPrun call \openout5 = `graphserieB-mprun.mp'. system(mpost -progname=mpost -mem=metafun graphserieB-mprun)...executed. Afterwards, metapost's output files named "graphserieA-mprun.1", "graphserieA-mprun.2", "graphserieB-mprun.1" and "graphserieB-mprun.2" would be created and then normally found by \externalfigure. Thanks again, -- pv > > You can redefine: > > \def\MPrunfile#1{\bufferprefix mprun.#1} > > to for instance > > \def\MPrunfile#1{\bufferprefix \MyMpRunFile.#1} > > \def\MyMpRunFile{mprun} > > > and them change the definition of \MyMpRunFile whenever you want > > Hans >> Hi, >> >> I run this simple test file test.tex : >> >> %&cont-en >> \setupoutput[pdftex] >> \runMPgraphicstrue >> \starttext >> \startMPrun >> input graphserieA >> \stopMPrun >> \externalfigure[mprun.1] >> \externalfigure[mprun.2] >> % >> \startMPrun >> input graphserieB >> \stopMPrun >> \externalfigure[mprun.1] >> \externalfigure[mprun.2] >> \stoptext >> \end . >> >> In the logfile, I got the messages : >> >> figures : figureobject test-mprun.1 is reused >> figures : figureobject test-mprun.2 is reused >> >> and twice the figures of graphserieA.mp on test.pdf. >> >> Is there a way to avoid the re-use of test-mprun.1 and test-mprun.2, I mean >> a way to overwrite the files test-mprun.1 and test-mprun.2 ? >> >> Or a way to get different names for each metapost output as, for example, >> graphserieA-mprun.1, graphserieA-mprun.2 and graphserieB-mprun.1, >> graphserieB-mprun.2 ? >> >> I could also give a different number to each of the figures in all of the >> *.mp files, but this solution is not pacticable since I have plenty of >> metapost files to process, each of it containing a lot of figures already >> numbered with almost the same numbers. Moreover, those numbers can not be >> modified because the figures are elsewhere referenced by their number and by >> the name of the metapost file.