From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24920 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: gnuplot for Mojca Date: Tue, 03 Jan 2006 23:07:45 +0100 Message-ID: <43BAF5B1.1010703@wxs.nl> References: <6faad9f00601030018h35a6a95cj5bf3ce468e39f4eb@mail.gmail.com> <6faad9f00601031227k520f1c82k386b7c246e7031f1@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1136326099 8330 80.91.229.2 (3 Jan 2006 22:08:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 3 Jan 2006 22:08:19 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 03 23:08:14 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EtuJt-0001iO-V9 for gctc-ntg-context-518@m.gmane.org; Tue, 03 Jan 2006 23:07:55 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 53EC0127B4; Tue, 3 Jan 2006 23:07:53 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29634-05; Tue, 3 Jan 2006 23:07:52 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A99FE12788; Tue, 3 Jan 2006 23:07:51 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E0A9512788 for ; Tue, 3 Jan 2006 23:07:49 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29786-02 for ; Tue, 3 Jan 2006 23:07:48 +0100 (CET) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id C57C11277F for ; Tue, 3 Jan 2006 23:07:48 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 10124 for ; Tue, 03 Jan 2006 23:16:42 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <6faad9f00601031227k520f1c82k386b7c246e7031f1@mail.gmail.com> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:24920 Archived-At: Mojca Miklavec wrote: >On 1/3/06, Peter M=C3=BCnster wrote: > =20 > >>On Tue, 3 Jan 2006, Mojca Miklavec wrote: >> >> =20 >> >>>Thanks a lot. I've learnt a lot from the example, it's only that in >>>the way it's written now it's not compatible with windows. >>> =20 >>> >>Hello Mojca, >>if you are using Windows, you can install MinGW, it's free and bash is >>included. >> =20 >> > >OK, that could be file for me and maybe for two others, but this can't >be a general solution. (Beginners wouldn't install it and the skilled >ones have linux anyway.) > =20 > that makes me a beginner >So my question for gurus remains: how to write a macro, so that > >\startGnuplotinclusions >set title "trigonometry" >\stopGnuplotinclusions >\startGnuplot >plot sin(x) >\stopGnuplot >\startGnuplot >plot cos(x) >\stopGnuplot > >would result in one file with > >set terminal postscript >set output "filename1" >set title "trigonometry" >plot sin(x) > >and the other one with > >set terminal postscript >set output "filename2" # If too complicated, the filename may remain the= same > =20 > why should it change an option is to collect *all graphic data* and do it in one run, in=20 which case we can gain some speed >set title "trigonometry" >plot cos(x) > > =20 > % output=3Dpdf \def\startGNUPLOTinclusions {\bgroup \obeylines \dostartGNUPLOTinclusions} \def\dostartGNUPLOTinclusions#1\stopGNUPLOTinclusions {\gdef\GNUPLOTinclusions{#1}% \egroup} \def\startGNUPLOTgraphic {\bgroup \obeylines \dostartGNUPLOTgraphic} \def\dostartGNUPLOTgraphic#1\stopGNUPLOTgraphic {\def\par{\rawcharacter{13}}% \immediate\openout\scratchwrite=3D\bufferprefix gnuplot.job \immediate\write\scratchwrite{\GNUPLOTinclusions}% \immediate\write\scratchwrite{set output "\bufferprefix gnuplot.ps"}% \immediate\write\scratchwrite{#1}% \immediate\closeout\scratchwrite \egroup \processGNUPLOTgraphic{\bufferprefix gnuplot}} \def\processGNUPLOTgraphic#1% {\executesystemcommand{start d:/gnuplot/bin/pgnuplot #1.job}% \executesystemcommand{texmfstart newpstopdf #1.ps}% \externalfigure[#1.pdf]} \starttext \startGNUPLOTinclusions set title "trigonometry" set terminal postscript \stopGNUPLOTinclusions \startGNUPLOTgraphic plot sin(x) \stopGNUPLOTgraphic \startGNUPLOTgraphic plot cos(x) \stopGNUPLOTgraphic \stoptext i leave it to you to figure out why i don't get output Hans